Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Django 如何通过PythonAnywhere.com部署网站_Django_Web_Deployment_Pythonanywhere - Fatal编程技术网

Django 如何通过PythonAnywhere.com部署网站

Django 如何通过PythonAnywhere.com部署网站,django,web,deployment,pythonanywhere,Django,Web,Deployment,Pythonanywhere,我收到了这个错误信息 所以我输入了setting.py文件并进行如下更改 ALLOWED_HOSTS = ['localhost', '127.0.0.1', '[::1]', '.pythonanywhere.com'] ALLOWED_HOSTS = ['heenamkang.pythonanywhere.com'] 并重新加载我的站点 但一切都没有改变 在这个时候,我像这样修改了代码 ALLOWED_HOSTS = ['localhost', '127.0.0.1', '[::1]

我收到了这个错误信息

所以我输入了setting.py文件并进行如下更改

ALLOWED_HOSTS = ['localhost', '127.0.0.1', '[::1]', '.pythonanywhere.com']
ALLOWED_HOSTS = ['heenamkang.pythonanywhere.com']
并重新加载我的站点

但一切都没有改变

在这个时候,我像这样修改了代码

ALLOWED_HOSTS = ['localhost', '127.0.0.1', '[::1]', '.pythonanywhere.com']
ALLOWED_HOSTS = ['heenamkang.pythonanywhere.com']
然后我收到了这个错误信息。这是反映变化的证据

但我仍然无法输入
'heenamkang.anywhere.com'


第三张和第四张图像是在同一时间拍摄的。

试试这个,它对我很有用

ALLOWED_HOSTS = ['127.0.0.1', u'heenamkang.pythonanywhere.com']

您的第一次回溯显示您的应用程序在Pythonywhere上运行。另一个显示在本地计算机上运行的应用程序


ALLOWED_HOSTS=['127.0.0.1','heenamkang.pythonanywhere.com']
应该足以使它在两种环境中都能工作。

尝试在pythonanywhere url之前添加


ALLOWED_HOSTS=['127.0.0.1','.heenamkang.pythonanywhere.com']

我尝试了这个,但是我收到了与我收到的相同的消息(我的第二个屏幕截图)。您确定在进行更改后重新加载了代码吗?您的第三个屏幕截图表明,在
允许的\u主机中添加
127.0.0.1
的操作尚未应用。我尝试了此操作,但收到了与我收到的相同的消息(我的第二个屏幕截图)非常感谢,但收到的消息与我收到的相同(我的第二个屏幕截图)