Invalid HTTP_HOST header: '192.168.55.10:8000'. You may need to add '192.168.55.10' to ALLOWED_HOSTS.
Request Method: GET
Request URL: http://192.168.55.10:8000/
Django Version: 2.1.8
Exception Type: DisallowedHost
Exception Value:
Invalid HTTP_HOST header: '192.168.55.10:8000'. You may need to add '192.168.55.10' to ALLOWED_HOSTS.
Exception Location: /usr/local/python3/lib/python3.6/site-packages/django/http/request.py in get_host, line 106
Python Executable: /usr/bin/python3
Python Version: 3.6.9
Python Path:
['/www/blog',
 '/usr/local/python3/lib/python36.zip',
 '/usr/local/python3/lib/python3.6',
 '/usr/local/python3/lib/python3.6/lib-dynload',
 '/root/.local/lib/python3.6/site-packages',
 '/usr/local/python3/lib/python3.6/site-packages']
Server time: 星期一, 21 十月 2019 17:07:12 +0800

在我们创建的项目里修改setting.py文件

ALLOWED_HOSTS = ['*']  #在这里请求的host添加了*

相关文章:

  • 2021-11-30
  • 2022-12-23
  • 2021-10-03
  • 2021-08-09
  • 2022-12-23
  • 2022-12-23
  • 2021-07-15
  • 2022-12-23
猜你喜欢
  • 2021-11-27
  • 2021-12-07
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案