Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能在另一台内网的linux上搭建吗 #4

Closed
airport666 opened this issue Mar 11, 2023 · 8 comments
Closed

能在另一台内网的linux上搭建吗 #4

airport666 opened this issue Mar 11, 2023 · 8 comments

Comments

@airport666
Copy link

能在另一台内网的linux上搭建吗,对接内网的群晖机器人,毕竟群晖装python3感觉头大,内网虚拟一台linux更轻松点

@GaiZhenbiao
Copy link
Owner

可以的。当然可以,填写正确的内网IP就行。不要再填127.0.0.1这个本地回环地址了。

@airport666
Copy link
Author

airport666 commented Mar 11, 2023

截屏2023-03-11 15 26 49

截屏2023-03-11 15 28 24

我碰到一个错误,不知道错在哪里

@GaiZhenbiao
Copy link
Owner

请提供更详细的信息。你这样我也没法看出错误原因。

@airport666
Copy link
Author

airport666 commented Mar 11, 2023

截屏2023-03-11 16 14 12

截屏2023-03-11 16 14 22

截屏2023-03-11 16 14 41

服务部署在10.10.10.13,裙晖地址在10.10.10.252,聊天界面用/newuser,服务端也会响应,但是是错误400

@GaiZhenbiao
Copy link
Owner

oh,这应该是ALLOWED_HOSTS设置有误,Django拒绝了不在白名单里的请求。
在本项目文件夹SynologyChatGPT下(注意和项目名重名),有一个settings.py。
image
在第28行这个列表中,加入群晖的内网IP10.10.10.252,成这样:

ALLOWED_HOSTS = ["10.10.10.252", "127.0.0.1"]

应该就可以解决400问题了。

@airport666
Copy link
Author

截屏2023-03-11 21 54 48

截屏2023-03-11 21 55 38

仍然报错400

@airport666
Copy link
Author

截屏2023-03-11 21 59 01

打开了debug,提示我还需要把服务端本级加入allowed hosts,试了一下,正常通讯了
截屏2023-03-11 22 00 51

@GaiZhenbiao
Copy link
Owner

原来是这样,那我关闭这个issue了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants