Django配備
django-admin.py startproject HelloWorld
cd HelloWorld
python manage.py runserver 119.23.175.75:8000
エラー:
解決策:
またエラーを報告します.
解決策:
cd HelloWorld
python manage.py runserver 119.23.175.75:8000
エラー:
[root@iZwz9j0rhuuld23m4jpvjiZ HelloWorld]# python manage.py runserver 119.23.175.75:8000
Performing system checks...
System check identified no issues (0 silenced).
You have 13 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
August 10, 2017 - 01:22:59
Django version 1.10.7, using settings 'HelloWorld.settings'
Starting development server at http://119.23.175.75:8000/
Quit the server with CONTROL-C.
Invalid HTTP_HOST header: '119.23.175.75:8000'. You may need to add u'119.23.175.75' to ALLOWED_HOSTS.
[10/Aug/2017 01:23:15] "GET / HTTP/1.1" 400 60326
Invalid HTTP_HOST header: '119.23.175.75:8000'. You may need to add u'119.23.175.75' to ALLOWED_HOSTS.
[10/Aug/2017 01:23:16] "GET /favicon.ico HTTP/1.1" 400 60408
^C[root@iZwz9j0rhuuld23m4jpvjiZ HelloWorld]# python manage.py migrate
解決策:
python manage.py migrate
またエラーを報告します.
[root@iZwz9j0rhuuld23m4jpvjiZ HelloWorld]# python manage.py runserver 119.23.175.75:8000
Performing system checks...
System check identified no issues (0 silenced).
August 10, 2017 - 01:24:13
Django version 1.10.7, using settings 'HelloWorld.settings'
Starting development server at http://119.23.175.75:8000/
Quit the server with CONTROL-C.
Invalid HTTP_HOST header: '119.23.175.75:8000'. You may need to add u'119.23.175.75' to ALLOWED_HOSTS.
[10/Aug/2017 01:24:29] "GET / HTTP/1.1" 400 60311
Invalid HTTP_HOST header: '119.23.175.75:8000'. You may need to add u'119.23.175.75' to ALLOWED_HOSTS.
[10/Aug/2017 01:24:29] "GET /favicon.ico HTTP/1.1" 400 60393
Invalid HTTP_HOST header: '119.23.175.75:8000'. You may need to add u'119.23.175.75' to ALLOWED_HOSTS.
[10/Aug/2017 01:24:32] "GET / HTTP/1.1" 400 60446
Invalid HTTP_HOST header: '119.23.175.75:8000'. You may need to add u'119.23.175.75' to ALLOWED_HOSTS.
解決策:
settings.py
ALLOWED_HOSTS = []
:
ALLOWED_HOSTS = ['*']