DisallowedHost at /
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添加了*