Неверный заголовок хоста в django
Среда:
Request Method: GET
Request URL: http://abampdb.......nust.edu.pk:83/
Django Version: 4.0.2
Python Version: 3.9.12
Installed Applications:
['abampdb.apps.AmpdbConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles']
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 (most recent call last):
File "/home/abampdb/projectdir/venv_name/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/home/abampdb/projectdir/venv_name/lib/python3.9/site-packages/django/utils/deprecation.py", line 125, in __call__
response = self.process_request(request)
File "/home/abampdb/projectdir/venv_name/lib/python3.9/site-packages/django/middleware/common.py", line 48, in process_request
host = request.get_host()
File "/home/abampdb/projectdir/venv_name/lib/python3.9/site-packages/django/http/request.py", line 135, in get_host
raise DisallowedHost(msg)
Exception Type: DisallowedHost at /
Exception Value: Invalid HTTP_HOST header: 'abampdb.......t.edu.pk:83'. You may need to add 'abampdb...........du.pk' to ALLOWED_HOSTS.
Я использовал nginx и gunicorn для развертывания по этой ссылке https://djangocentral.com/deploy-django-with-nginx-gunicorn-postgresql-and-lets-encrypt-ssl-on-ubuntu/.
Я отредактировал settings.py также с именем домена в Allowed Host, но все равно получаю ту же ошибку, и после редактирования я также выполнил команду gunicorn restart и команду nginx reload. вот мой