Mam problem. Robię sobie bloga tutoriala z Django i cały czas mam to samo. Piszę polecenie python manage.py runserver, no i załączam stronkę, ale nie idzie. Wiecie o co chodzi?
Jestem na tym etapie w tutorialu: https://tutorial.djangogirls.org/pl/html/
DisallowedHost at /
Invalid HTTP_HOST header: '127.0.0.1:8000'. You may need to add '127.0.0.1' to ALLOWED_HOSTS.
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.11.8
Exception Type: DisallowedHost
Exception Value:
Invalid HTTP_HOST header: '127.0.0.1:8000'. You may need to add '127.0.0.1' to ALLOWED_HOSTS.
Exception Location: E:\Anaconda\envs\myDjangoEnv\lib\site-packages\django\http\request.py in get_host, line 113
Python Executable: E:\Anaconda\envs\myDjangoEnv\python.exe
Python Version: 3.5.4
Python Path:
['E:\Programy Python\Python Udemy\Python\BLOG_SI',
'E:\Anaconda\envs\myDjangoEnv\python35.zip',
'E:\Anaconda\envs\myDjangoEnv\DLLs',
'E:\Anaconda\envs\myDjangoEnv\lib',
'E:\Anaconda\envs\myDjangoEnv',
'E:\Anaconda\envs\myDjangoEnv\lib\site-packages']
Server time: Tue, 6 Feb 2018 2257 +0100
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.11.8
Python Version: 3.5.4
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'blog']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']
Traceback:
File "E:\Anaconda\envs\myDjangoEnv\lib\site-packages\django\core\handlers\exception.py" in inner
41. response = get_response(request)
File "E:\Anaconda\envs\myDjangoEnv\lib\site-packages\django\utils\deprecation.py" in call
138. response = self.process_request(request)
File "E:\Anaconda\envs\myDjangoEnv\lib\site-packages\django\middleware\common.py" in process_request
57. host = request.get_host()
File "E:\Anaconda\envs\myDjangoEnv\lib\site-packages\django\http\request.py" in get_host
113. raise DisallowedHost(msg)
Exception Type: DisallowedHost at /
Exception Value: Invalid HTTP_HOST header: '127.0.0.1:8000'. You may need to add '127.0.0.1' to ALLOWED_HOSTS.