DisallowedHost at /subnl/

Invalid HTTP_HOST header: 'lite.vinij.ir'. You may need to add 'lite.vinij.ir' to ALLOWED_HOSTS.
Request Method: GET
Request URL: https://lite.vinij.ir/subnl/
Django Version: 5.2.6
Exception Type: DisallowedHost
Exception Value:
Invalid HTTP_HOST header: 'lite.vinij.ir'. You may need to add 'lite.vinij.ir' to ALLOWED_HOSTS.
Exception Location: /root/Accounting/.venv/lib/python3.10/site-packages/django/http/request.py, line 202, in get_host
Python Executable: /root/Accounting/.venv/bin/python
Python Version: 3.10.12
Python Path:
['/root/Accounting/Accounting',
 '/root/Accounting/.venv/bin',
 '/usr/lib/python310.zip',
 '/usr/lib/python3.10',
 '/usr/lib/python3.10/lib-dynload',
 '/root/Accounting/.venv/lib/python3.10/site-packages']
Server time: Sat, 08 Nov 2025 08:29:08 +0330

Traceback Switch to copy-and-paste view

  • /root/Accounting/.venv/lib/python3.10/site-packages/django/core/handlers/exception.py, line 55, in inner
    1.         return inner
    2.     else:
    3.         @wraps(get_response)
    4.         def inner(request):
    5.             try:
    1.                 response = get_response(request)
    1.             except Exception as exc:
    2.                 response = response_for_exception(request, exc)
    3.             return response
    4.         return inner
    Local vars
    Variable Value
    exc
    DisallowedHost("Invalid HTTP_HOST header: 'lite.vinij.ir'. You may need to add 'lite.vinij.ir' to ALLOWED_HOSTS.")
    get_response
    <CommonMiddleware get_response=convert_exception_to_response.<locals>.inner>
    request
    <WSGIRequest: GET '/subnl/'>
  • /root/Accounting/.venv/lib/python3.10/site-packages/django/utils/deprecation.py, line 119, in __call__
    1.     def __call__(self, request):
    2.         # Exit out to async mode, if needed
    3.         if self.async_mode:
    4.             return self.__acall__(request)
    5.         response = None
    6.         if hasattr(self, "process_request"):
    1.             response = self.process_request(request)
    1.         response = response or self.get_response(request)
    2.         if hasattr(self, "process_response"):
    3.             response = self.process_response(request, response)
    4.         return response
    5.     async def __acall__(self, request):
    Local vars
    Variable Value
    request
    <WSGIRequest: GET '/subnl/'>
    response
    None
    self
    <CommonMiddleware get_response=convert_exception_to_response.<locals>.inner>
  • /root/Accounting/.venv/lib/python3.10/site-packages/django/middleware/common.py, line 48, in process_request
    1.         user_agent = request.META.get("HTTP_USER_AGENT")
    2.         if user_agent is not None:
    3.             for user_agent_regex in settings.DISALLOWED_USER_AGENTS:
    4.                 if user_agent_regex.search(user_agent):
    5.                     raise PermissionDenied("Forbidden user agent")
    6.         # Check for a redirect based on settings.PREPEND_WWW
    1.         host = request.get_host()
    1.         if settings.PREPEND_WWW and host and not host.startswith("www."):
    2.             # Check if we also need to append a slash so we can do it all
    3.             # with a single redirect. (This check may be somewhat expensive,
    4.             # so we only do it if we already know we're sending a redirect,
    5.             # or in process_response if we get a 404.)
    Local vars
    Variable Value
    request
    <WSGIRequest: GET '/subnl/'>
    self
    <CommonMiddleware get_response=convert_exception_to_response.<locals>.inner>
    user_agent
    ('Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; '
     'ClaudeBot/1.0; +claudebot@anthropic.com)')
  • /root/Accounting/.venv/lib/python3.10/site-packages/django/http/request.py, line 202, in get_host
    1.             msg = "Invalid HTTP_HOST header: %r." % host
    2.             if domain:
    3.                 msg += " You may need to add %r to ALLOWED_HOSTS." % domain
    4.             else:
    5.                 msg += (
    6.                     " The domain name provided is not valid according to RFC 1034/1035."
    7.                 )
    1.             raise DisallowedHost(msg)
    1.     def get_port(self):
    2.         """Return the port number for the request as a string."""
    3.         if settings.USE_X_FORWARDED_PORT and "HTTP_X_FORWARDED_PORT" in self.META:
    4.             port = self.META["HTTP_X_FORWARDED_PORT"]
    5.         else:
    Local vars
    Variable Value
    allowed_hosts
    ['5.255.115.148', 'hunaex.shop']
    domain
    'lite.vinij.ir'
    host
    'lite.vinij.ir'
    msg
    ("Invalid HTTP_HOST header: 'lite.vinij.ir'. You may need to add "
     "'lite.vinij.ir' to ALLOWED_HOSTS.")
    port
    ''
    self
    <WSGIRequest: GET '/subnl/'>


Request information

USER

[unable to retrieve the current user]

GET

No GET data

POST

No POST data

FILES

No FILES data

No cookie data

META

Variable Value
HTTP_ACCEPT
'*/*'
HTTP_CONNECTION
'close'
HTTP_HOST
'lite.vinij.ir'
HTTP_USER_AGENT
('Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; '
 'ClaudeBot/1.0; +claudebot@anthropic.com)')
HTTP_X_FORWARDED_FOR
'85.9.107.3'
HTTP_X_FORWARDED_PROTO
'https'
HTTP_X_REAL_IP
'85.9.107.3'
PATH_INFO
'/subnl/'
QUERY_STRING
''
RAW_URI
'/subnl/'
REMOTE_ADDR
''
REQUEST_METHOD
'GET'
SCRIPT_NAME
''
SERVER_NAME
'lite.vinij.ir'
SERVER_PORT
'443'
SERVER_PROTOCOL
'HTTP/1.0'
SERVER_SOFTWARE
'gunicorn/23.0.0'
gunicorn.socket
<socket.socket fd=9, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0, laddr=/run/gunicorn.sock>
wsgi.errors
<gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7f4100059e40>
wsgi.file_wrapper
<class 'gunicorn.http.wsgi.FileWrapper'>
wsgi.input
<gunicorn.http.body.Body object at 0x7f41000599c0>
wsgi.input_terminated
True
wsgi.multiprocess
True
wsgi.multithread
False
wsgi.run_once
False
wsgi.url_scheme
'https'
wsgi.version
(1, 0)

Settings

Using settings module Accounting.settings

Setting Value
ABSOLUTE_URL_OVERRIDES
{}
ADMINS
[]
ALLOWED_HOSTS
['5.255.115.148', 'hunaex.shop']
APPEND_SLASH
True
AUTHENTICATION_BACKENDS
'********************'
AUTH_PASSWORD_VALIDATORS
'********************'
AUTH_USER_MODEL
'********************'
BASE_DIR
PosixPath('/root/Accounting/Accounting')
CACHES
{'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}
CACHE_MIDDLEWARE_ALIAS
'default'
CACHE_MIDDLEWARE_KEY_PREFIX
'********************'
CACHE_MIDDLEWARE_SECONDS
600
CSRF_COOKIE_AGE
31449600
CSRF_COOKIE_DOMAIN
None
CSRF_COOKIE_HTTPONLY
False
CSRF_COOKIE_NAME
'csrftoken'
CSRF_COOKIE_PATH
'/'
CSRF_COOKIE_SAMESITE
'Lax'
CSRF_COOKIE_SECURE
False
CSRF_FAILURE_VIEW
'django.views.csrf.csrf_failure'
CSRF_HEADER_NAME
'HTTP_X_CSRFTOKEN'
CSRF_TRUSTED_ORIGINS
[]
CSRF_USE_SESSIONS
False
DATABASES
{'default': {'ATOMIC_REQUESTS': False,
             'AUTOCOMMIT': True,
             'CONN_HEALTH_CHECKS': False,
             'CONN_MAX_AGE': 0,
             'ENGINE': 'django.db.backends.postgresql',
             'HOST': 'localhost',
             'NAME': 'Accounting',
             'OPTIONS': {},
             'PASSWORD': '********************',
             'PORT': '',
             'TEST': {'CHARSET': None,
                      'COLLATION': None,
                      'MIGRATE': True,
                      'MIRROR': None,
                      'NAME': None},
             'TIME_ZONE': None,
             'USER': 'pouya'}}
DATABASE_ROUTERS
[]
DATA_UPLOAD_MAX_MEMORY_SIZE
2621440
DATA_UPLOAD_MAX_NUMBER_FIELDS
1000
DATA_UPLOAD_MAX_NUMBER_FILES
100
DATETIME_FORMAT
'N j, Y, P'
DATETIME_INPUT_FORMATS
['%Y-%m-%d %H:%M:%S',
 '%Y-%m-%d %H:%M:%S.%f',
 '%Y-%m-%d %H:%M',
 '%m/%d/%Y %H:%M:%S',
 '%m/%d/%Y %H:%M:%S.%f',
 '%m/%d/%Y %H:%M',
 '%m/%d/%y %H:%M:%S',
 '%m/%d/%y %H:%M:%S.%f',
 '%m/%d/%y %H:%M']
DATE_FORMAT
'N j, Y'
DATE_INPUT_FORMATS
['%Y-%m-%d',
 '%m/%d/%Y',
 '%m/%d/%y',
 '%b %d %Y',
 '%b %d, %Y',
 '%d %b %Y',
 '%d %b, %Y',
 '%B %d %Y',
 '%B %d, %Y',
 '%d %B %Y',
 '%d %B, %Y']
DEBUG
True
DEBUG_PROPAGATE_EXCEPTIONS
False
DECIMAL_SEPARATOR
'.'
DEFAULT_AUTO_FIELD
'django.db.models.BigAutoField'
DEFAULT_CHARSET
'utf-8'
DEFAULT_EXCEPTION_REPORTER
'django.views.debug.ExceptionReporter'
DEFAULT_EXCEPTION_REPORTER_FILTER
'django.views.debug.SafeExceptionReporterFilter'
DEFAULT_FROM_EMAIL
'webmaster@localhost'
DEFAULT_INDEX_TABLESPACE
''
DEFAULT_TABLESPACE
''
DISALLOWED_USER_AGENTS
[]
EMAIL_BACKEND
'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST
'localhost'
EMAIL_HOST_PASSWORD
'********************'
EMAIL_HOST_USER
''
EMAIL_PORT
25
EMAIL_SSL_CERTFILE
None
EMAIL_SSL_KEYFILE
'********************'
EMAIL_SUBJECT_PREFIX
'[Django] '
EMAIL_TIMEOUT
None
EMAIL_USE_LOCALTIME
False
EMAIL_USE_SSL
False
EMAIL_USE_TLS
False
FILE_UPLOAD_DIRECTORY_PERMISSIONS
None
FILE_UPLOAD_HANDLERS
['django.core.files.uploadhandler.MemoryFileUploadHandler',
 'django.core.files.uploadhandler.TemporaryFileUploadHandler']
FILE_UPLOAD_MAX_MEMORY_SIZE
2621440
FILE_UPLOAD_PERMISSIONS
420
FILE_UPLOAD_TEMP_DIR
None
FIRST_DAY_OF_WEEK
0
FIXTURE_DIRS
[]
FORCE_SCRIPT_NAME
None
FORMAT_MODULE_PATH
None
FORMS_URLFIELD_ASSUME_HTTPS
False
FORM_RENDERER
'django.forms.renderers.DjangoTemplates'
IGNORABLE_404_URLS
[]
INSTALLED_APPS
['jalali_date',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'dashboard',
 'mathfilters',
 'django_filters']
INTERNAL_IPS
[]
JALALI_DATE_DEFAULTS
{'LIST_DISPLAY_AUTO_CONVERT': False,
 'Static': {'css': {'all': ['admin/css/django_jalali.min.css']},
            'js': ['admin/js/django_jalali.min.js']},
 'Strftime': {'date': '%y/%m/%d', 'datetime': '%H:%M:%S _ %y/%m/%d'}}
LANGUAGES
[('fa', 'فارسی'), ('en', 'انگلیسی')]
LANGUAGES_BIDI
['he', 'ar', 'ar-dz', 'ckb', 'fa', 'ug', 'ur']
LANGUAGE_CODE
'fa-ir'
LANGUAGE_COOKIE_AGE
None
LANGUAGE_COOKIE_DOMAIN
None
LANGUAGE_COOKIE_HTTPONLY
False
LANGUAGE_COOKIE_NAME
'django_language'
LANGUAGE_COOKIE_PATH
'/'
LANGUAGE_COOKIE_SAMESITE
None
LANGUAGE_COOKIE_SECURE
False
LOCALE_PATHS
[PosixPath('/root/Accounting/Accounting/locale')]
LOGGING
{}
LOGGING_CONFIG
'logging.config.dictConfig'
LOGIN_REDIRECT_URL
'dashboard:financial_report'
LOGIN_URL
'login'
LOGOUT_REDIRECT_URL
'login'
MANAGERS
[]
MEDIA_ROOT
PosixPath('/root/Accounting/Accounting/media')
MEDIA_URL
'/media/'
MESSAGE_STORAGE
'django.contrib.messages.storage.fallback.FallbackStorage'
MIDDLEWARE
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']
MIGRATION_MODULES
{}
MONTH_DAY_FORMAT
'F j'
NUMBER_GROUPING
0
PASSWORD_HASHERS
'********************'
PASSWORD_RESET_TIMEOUT
'********************'
PREPEND_WWW
False
ROOT_URLCONF
'Accounting.urls'
SECRET_KEY
'********************'
SECRET_KEY_FALLBACKS
'********************'
SECURE_CONTENT_TYPE_NOSNIFF
True
SECURE_CROSS_ORIGIN_OPENER_POLICY
'same-origin'
SECURE_HSTS_INCLUDE_SUBDOMAINS
False
SECURE_HSTS_PRELOAD
False
SECURE_HSTS_SECONDS
0
SECURE_PROXY_SSL_HEADER
None
SECURE_REDIRECT_EXEMPT
[]
SECURE_REFERRER_POLICY
'same-origin'
SECURE_SSL_HOST
None
SECURE_SSL_REDIRECT
False
SERVER_EMAIL
'root@localhost'
SESSION_CACHE_ALIAS
'default'
SESSION_COOKIE_AGE
1209600
SESSION_COOKIE_DOMAIN
None
SESSION_COOKIE_HTTPONLY
True
SESSION_COOKIE_NAME
'sessionid'
SESSION_COOKIE_PATH
'/'
SESSION_COOKIE_SAMESITE
'Lax'
SESSION_COOKIE_SECURE
False
SESSION_ENGINE
'django.contrib.sessions.backends.db'
SESSION_EXPIRE_AT_BROWSER_CLOSE
False
SESSION_FILE_PATH
None
SESSION_SAVE_EVERY_REQUEST
False
SESSION_SERIALIZER
'django.contrib.sessions.serializers.JSONSerializer'
SETTINGS_MODULE
'Accounting.settings'
SHORT_DATETIME_FORMAT
'm/d/Y P'
SHORT_DATE_FORMAT
'm/d/Y'
SIGNING_BACKEND
'django.core.signing.TimestampSigner'
SILENCED_SYSTEM_CHECKS
[]
STATICFILES_DIRS
[PosixPath('/root/Accounting/Accounting/static')]
STATICFILES_FINDERS
['django.contrib.staticfiles.finders.FileSystemFinder',
 'django.contrib.staticfiles.finders.AppDirectoriesFinder']
STATIC_ROOT
PosixPath('/root/Accounting/Accounting/staticfiles')
STATIC_URL
'/static/'
STORAGES
{'default': {'BACKEND': 'django.core.files.storage.FileSystemStorage'},
 'staticfiles': {'BACKEND': 'django.contrib.staticfiles.storage.StaticFilesStorage'}}
TEMPLATES
[{'APP_DIRS': True,
  'BACKEND': 'django.template.backends.django.DjangoTemplates',
  'DIRS': [],
  'OPTIONS': {'context_processors': ['django.template.context_processors.debug',
                                     'django.template.context_processors.request',
                                     'django.contrib.auth.context_processors.auth',
                                     'django.contrib.messages.context_processors.messages']}}]
TEST_NON_SERIALIZED_APPS
[]
TEST_RUNNER
'django.test.runner.DiscoverRunner'
THOUSAND_SEPARATOR
','
TIME_FORMAT
'P'
TIME_INPUT_FORMATS
['%H:%M:%S', '%H:%M:%S.%f', '%H:%M']
TIME_ZONE
'Asia/Tehran'
USE_I18N
True
USE_THOUSAND_SEPARATOR
False
USE_TZ
True
USE_X_FORWARDED_HOST
False
USE_X_FORWARDED_PORT
False
WSGI_APPLICATION
'Accounting.wsgi.application'
X_FRAME_OPTIONS
'DENY'
YEAR_MONTH_FORMAT
'F Y'