DisallowedHost at / Invalid HTTP_HOST header: 'hatsunami.pythonanywhere.com'. You may need to add 'hatsunami.pythonanywhere.com' to ALLOWED_HOSTS. Request Method: GET Request URL: http://hatsunami.pythonanywhere.com/ Django Version: 1.10.3 Exception Type: DisallowedHost Exception Value: Invalid HTTP_HOST header: 'hatsunami.pythonanywhere.com'. You may need to add 'hatsunami.pythonanywhere.com' to ALLOWED_HOSTS. Exception Location: /home/hatsunami/my-first-blog/myvenv/lib/python3.4/site-packages/django/http/request.py in get_host, line 113 Python Executable: /usr/local/bin/uwsgi Python Version: 3.4.3 Python Path: ['/var/www', '.', '', '/var/www', '/home/hatsunami/my-first-blog/myvenv/lib/python3.4', '/home/hatsunami/my-first-blog/myvenv/lib/python3.4/plat-x86_64-linux-gnu', '/home/hatsunami/my-first-blog/myvenv/lib/python3.4/lib-dynload', '/usr/lib/python3.4', '/usr/lib/python3.4/plat-x86_64-linux-gnu', '/home/hatsunami/my-first-blog/myvenv/lib/python3.4/site-packages', '/home/hatsunami/my-first-blog'] Server time: Tue, 22 Nov 2016 17:33:43 +0300 raceback Switch to copy-and-paste view /home/hatsunami/my-first-blog/myvenv/lib/python3.4/site-packages/django/core/handlers/exception.py in inner response = get_response(request) ▶ Local vars /home/hatsunami/my-first-blog/myvenv/lib/python3.4/site-packages/django/core/handlers/base.py in _legacy_get_response response = middleware_method(request) ▶ Local vars /home/hatsunami/my-first-blog/myvenv/lib/python3.4/site-packages/django/middleware/common.py in process_request host = request.get_host() ▶ Local vars /home/hatsunami/my-first-blog/myvenv/lib/python3.4/site-packages/django/http/request.py in get_host raise DisallowedHost(msg) ▶ Local vars 

Please tell me what to do.

  • Well, in the text of the error in plain text it says what to do - andreymal

1 answer 1

Add to settings.py

 ALLOWED_HOSTS = ('hatsunami.pythonanywhere.com', )