type object 'Http404' has no attribute 'get'
Request Method: | GET |
---|---|
Request URL: | http://c947-nareva.wbc-prod.com/fr/activite/energies-fossiles |
Django Version: | 2.2 |
Exception Type: | AttributeError |
Exception Value: | type object 'Http404' has no attribute 'get' |
Exception Location: | /usr/local/lib/python3.8/site-packages/django/middleware/clickjacking.py in process_response, line 26 |
Python Executable: | /usr/local/bin/python |
Python Version: | 3.8.2 |
Python Path: | ['/src', '/src', '/usr/local/bin', '/usr/local/lib/python38.zip', '/usr/local/lib/python3.8', '/usr/local/lib/python3.8/lib-dynload', '/usr/local/lib/python3.8/site-packages'] |
Server time: | ven, 29 Mar 2024 04:49:03 +0000 |
/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py
in inner
This decorator is automatically applied to all middleware to ensure that
no middleware leaks an exception and that the next middleware in the stack
can rely on getting a response instead of an exception.
"""
@wraps(get_response)
def inner(request):
try:
response = get_response(request)…
except Exception as exc:
response = response_for_exception(request, exc)
return response
return inner
Variable | Value |
---|---|
exc | AttributeError("type object 'Http404' has no attribute 'get'") |
get_response | <sentry_sdk.integrations.django.middleware._wrap_middleware.<locals>.SentryWrappingMiddleware object at 0x7f5ec1888d00> |
request | <WSGIRequest: GET '/fr/activite/energies-fossiles'> |
/usr/local/lib/python3.8/site-packages/sentry_sdk/integrations/django/middleware.py
in __call__
return rv
def __call__(self, *args, **kwargs):
# type: (*Any, **Any) -> Any
f = self._call_method
if f is None:
self._call_method = f = _get_wrapped_method(self._inner.__call__)
return f(*args, **kwargs)…
if hasattr(middleware, "__name__"):
SentryWrappingMiddleware.__name__ = middleware.__name__
return SentryWrappingMiddleware
Variable | Value |
---|---|
_get_wrapped_method | <function _wrap_middleware.<locals>._get_wrapped_method at 0x7f5ec181a040> |
args | (<WSGIRequest: GET '/fr/activite/energies-fossiles'>,) |
f | <function MiddlewareMixin.__call__ at 0x7f5ec1267700> |
kwargs | {} |
self | <sentry_sdk.integrations.django.middleware._wrap_middleware.<locals>.SentryWrappingMiddleware object at 0x7f5ec1888d00> |
/usr/local/lib/python3.8/site-packages/sentry_sdk/integrations/django/middleware.py
in sentry_wrapped_method
description = "{}.{}".format(description, function_basename)
with hub.start_span(
op="django.middleware", description=description
) as span:
span.set_tag("django.function_name", function_name)
span.set_tag("django.middleware_name", middleware_name)
return old_method(*args, **kwargs)…
try:
# fails for __call__ of function on Python 2 (see py2.7-django-1.11)
return wraps(old_method)(sentry_wrapped_method) # type: ignore
except Exception:
return sentry_wrapped_method # type: ignore
Variable | Value |
---|---|
DjangoIntegration | <class 'sentry_sdk.integrations.django.DjangoIntegration'> |
args | (<WSGIRequest: GET '/fr/activite/energies-fossiles'>,) |
description | 'django.middleware.clickjacking.XFrameOptionsMiddleware.__call__' |
function_basename | '__call__' |
function_name | 'django.utils.deprecation.MiddlewareMixin.__call__' |
hub | <sentry_sdk.hub.Hub object at 0x7f5ec0f67e20> |
integration | <sentry_sdk.integrations.django.DjangoIntegration object at 0x7f5ec2c404f0> |
kwargs | {} |
middleware_name | 'django.middleware.clickjacking.XFrameOptionsMiddleware' |
old_method | <bound method MiddlewareMixin.__call__ of <django.middleware.clickjacking.XFrameOptionsMiddleware object at 0x7f5ec1888eb0>> |
span | <Span(transaction=None, trace_id='d56b7e76aa5d4aa8a7df7eeb29dadb85', span_id='bb18317668197d1b', parent_span_id='810c147a4641f7ea', sampled=False)> |
/usr/local/lib/python3.8/site-packages/django/utils/deprecation.py
in __call__
def __call__(self, request):
response = None
if hasattr(self, 'process_request'):
response = self.process_request(request)
response = response or self.get_response(request)
if hasattr(self, 'process_response'):
response = self.process_response(request, response)…
return response
Variable | Value |
---|---|
request | <WSGIRequest: GET '/fr/activite/energies-fossiles'> |
response | <class 'django.http.response.Http404'> |
self | <django.middleware.clickjacking.XFrameOptionsMiddleware object at 0x7f5ec1888eb0> |
/usr/local/lib/python3.8/site-packages/django/middleware/clickjacking.py
in process_response
By default, set the X-Frame-Options header to 'SAMEORIGIN', meaning the
response can only be loaded on a frame within the same site. To prevent the
response from being loaded in a frame in any site, set X_FRAME_OPTIONS in
your project's Django settings to 'DENY'.
"""
def process_response(self, request, response):
# Don't set it if it's already in the response
if response.get('X-Frame-Options') is not None:…
return response
# Don't set it if they used @xframe_options_exempt
if getattr(response, 'xframe_options_exempt', False):
return response
Variable | Value |
---|---|
request | <WSGIRequest: GET '/fr/activite/energies-fossiles'> |
response | <class 'django.http.response.Http404'> |
self | <django.middleware.clickjacking.XFrameOptionsMiddleware object at 0x7f5ec1888eb0> |
AnonymousUser
No GET data
No POST data
No FILES data
No cookie data
Variable | Value |
---|---|
HTTP_ACCEPT | '*/*' |
HTTP_CONNECTION | 'close' |
HTTP_HOST | 'c947-nareva.wbc-prod.com' |
HTTP_REFERER | 'https://c947-nareva.wbc-prod.com/activite/energies-fossiles' |
HTTP_USER_AGENT | 'claudebot' |
HTTP_X_FORWARDED_FOR | '3.81.23.50' |
HTTP_X_FORWARDED_PROTO | 'https' |
HTTP_X_REAL_IP | '3.81.23.50' |
PATH_INFO | '/fr/activite/energies-fossiles' |
QUERY_STRING | '' |
RAW_URI | '/fr/activite/energies-fossiles' |
REMOTE_ADDR | '192.168.16.1' |
REMOTE_PORT | '33826' |
REQUEST_METHOD | 'GET' |
SCRIPT_NAME | '' |
SERVER_NAME | '0.0.0.0' |
SERVER_PORT | '8000' |
SERVER_PROTOCOL | 'HTTP/1.0' |
SERVER_SOFTWARE | 'gunicorn/20.0.4' |
gunicorn.socket | <socket.socket fd=10, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('192.168.16.4', 8000), raddr=('192.168.16.1', 33826)> |
wsgi.errors | <gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7f5ec0deeaf0> |
wsgi.file_wrapper | '' |
wsgi.input | <gunicorn.http.body.Body object at 0x7f5ec0f67f70> |
wsgi.input_terminated | True |
wsgi.multiprocess | True |
wsgi.multithread | False |
wsgi.run_once | False |
wsgi.url_scheme | 'http' |
wsgi.version | (1, 0) |
app.settings
Setting | Value |
---|---|
ABSOLUTE_URL_OVERRIDES | {} |
ADMINS | [] |
ALLOWED_HOSTS | ['c947-nareva.wbc-prod.com'] |
API_ACTUS_TOKEN | '********************' |
APPEND_SLASH | True |
AUTHENTICATION_BACKENDS | ['django.contrib.auth.backends.ModelBackend'] |
AUTH_PASSWORD_VALIDATORS | '********************' |
AUTH_USER_MODEL | 'auth.User' |
BASE_DIR | '/src' |
CACHES | {'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}} |
CACHE_MIDDLEWARE_ALIAS | 'default' |
CACHE_MIDDLEWARE_KEY_PREFIX | '********************' |
CACHE_MIDDLEWARE_SECONDS | 600 |
CORS_ALLOWED_ORIGINS | ['https://c947-nareva.wbc-prod.com'] |
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_MAX_AGE': 0, 'ENGINE': 'django.db.backends.postgresql', 'HOST': 'postgres', 'NAME': 'c947_preprod_bdd', 'OPTIONS': {}, 'PASSWORD': '********************', 'PORT': '5432', 'TEST': {'CHARSET': None, 'COLLATION': None, 'MIRROR': None, 'NAME': None}, 'TIME_ZONE': None, 'USER': 'c947_preprod'}} |
DATABASE_ROUTERS | [] |
DATA_UPLOAD_MAX_MEMORY_SIZE | 2621440 |
DATA_UPLOAD_MAX_NUMBER_FIELDS | 1000 |
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', '%Y-%m-%d', '%m/%d/%Y %H:%M:%S', '%m/%d/%Y %H:%M:%S.%f', '%m/%d/%Y %H:%M', '%m/%d/%Y', '%m/%d/%y %H:%M:%S', '%m/%d/%y %H:%M:%S.%f', '%m/%d/%y %H:%M', '%m/%d/%y'] |
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_CHARSET | 'utf-8' |
DEFAULT_CONTENT_TYPE | 'text/html' |
DEFAULT_EXCEPTION_REPORTER_FILTER | 'django.views.debug.SafeExceptionReporterFilter' |
DEFAULT_FILE_STORAGE | 'django.core.files.storage.FileSystemStorage' |
DEFAULT_FROM_EMAIL | 'nareva<noreply@wbc-emailing.com>' |
DEFAULT_INDEX_TABLESPACE | '' |
DEFAULT_TABLESPACE | '' |
DEFENDER_COOLOFF_TIME | 86400 |
DEFENDER_DISABLE_IP_LOCKOUT | 'TRUE' |
DEFENDER_LOGIN_FAILURE_LIMIT | 5 |
DEFENDER_REDIS_URL | 'redis://redis:6379/2' |
DEFENDER_USERNAME_FORM_FIELD | 'auth-username' |
DISALLOWED_USER_AGENTS | [] |
EMAIL_BACKEND | 'django.core.mail.backends.smtp.EmailBackend' |
EMAIL_HOST | 'email-smtp.eu-west-1.amazonaws.com' |
EMAIL_HOST_PASSWORD | '********************' |
EMAIL_HOST_USER | 'AKIAIJ7ROI3YJOKOCDZQ' |
EMAIL_PORT | '587' |
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 | True |
ENV | 'staging' |
ENV_TEST | 'TRUE' |
FILE_CHARSET | 'utf-8' |
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 | None |
FILE_UPLOAD_TEMP_DIR | None |
FIRST_DAY_OF_WEEK | 0 |
FIXTURE_DIRS | [] |
FORCE_SCRIPT_NAME | None |
FORMAT_MODULE_PATH | None |
FORM_RENDERER | 'django.forms.renderers.DjangoTemplates' |
HAYSTACK_CONNECTIONS | {'default': {'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine', 'PATH': '/data/whoosh_index'}} |
IGNORABLE_404_URLS | [] |
INSTALLED_APPS | ['modeltranslation', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django_extensions', 'django_otp', 'django_otp.plugins.otp_static', 'django_otp.plugins.otp_totp', 'two_factor', 'haystack', 'defender', 'preference', 'content', 'custom_flatpages', 'nous_connaitre', 'contact', 'taggit', 'meta', 'adminsortable2', 'custom_two_factor_auth', 'django_hide', 'corsheaders', 'django_celery_beat', 'django_celery_results'] |
INTERNAL_IPS | [] |
LANGUAGES | (('fr', 'Français'), ('en', 'Anglais'), ('ar', 'Arabe')) |
LANGUAGES_BIDI | ['he', 'ar', 'fa', 'ur'] |
LANGUAGE_CODE | 'fr' |
LANGUAGE_COOKIE_AGE | None |
LANGUAGE_COOKIE_DOMAIN | None |
LANGUAGE_COOKIE_NAME | 'django_language' |
LANGUAGE_COOKIE_PATH | '/' |
LOCALE_PATHS | ['/src/locale'] |
LOGGING | {} |
LOGGING_CONFIG | 'logging.config.dictConfig' |
LOGIN_REDIRECT_URL | '/site_access947/' |
LOGIN_URL | 'two_factor:login' |
LOGOUT_REDIRECT_URL | None |
MANAGERS | [] |
MEDIA_ROOT | '/data/media' |
MEDIA_URL | '/media/' |
MESSAGE_STORAGE | 'django.contrib.messages.storage.fallback.FallbackStorage' |
META_USE_TITLE_TAG | True |
MIDDLEWARE | ['django_hide.middleware.CSRFHIDEMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'corsheaders.middleware.CorsMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'defender.middleware.FailedLoginMiddleware', 'django_otp.middleware.OTPMiddleware', 'app.middleware.SessionTimeoutMiddleware'] |
MIGRATION_MODULES | {} |
MODELTRANSLATION_TRANSLATION_FILES | ('content.translation', 'preference.translation', 'nous_connaitre.translation', 'custom_flatpages.translation') |
MONTH_DAY_FORMAT | 'F j' |
NUMBER_GROUPING | 0 |
PASSWORD_HASHERS | '********************' |
PASSWORD_RESET_TIMEOUT_DAYS | '********************' |
PREPEND_WWW | False |
PROFILE_REDIRECT_URL | 'profile' |
REDIS_CACHE | {'db': 2, 'host': 'redis', 'port': 6379} |
ROOT_URLCONF | 'app.urls' |
SECRET_KEY | '********************' |
SECURE_BROWSER_XSS_FILTER | False |
SECURE_CONTENT_TYPE_NOSNIFF | False |
SECURE_HSTS_INCLUDE_SUBDOMAINS | False |
SECURE_HSTS_PRELOAD | False |
SECURE_HSTS_SECONDS | 0 |
SECURE_PROXY_SSL_HEADER | None |
SECURE_REDIRECT_EXEMPT | [] |
SECURE_SSL_HOST | None |
SECURE_SSL_REDIRECT | False |
SENTRY_KEY | '********************' |
SENTRY_PROJECT_ID | '5218709' |
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_EXPIRE_SECONDS | 3600 |
SESSION_FILE_PATH | None |
SESSION_SAVE_EVERY_REQUEST | False |
SESSION_SERIALIZER | 'django.contrib.sessions.serializers.JSONSerializer' |
SETTINGS_MODULE | 'app.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 | ('/src/static',) |
STATICFILES_FINDERS | ['django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder'] |
STATICFILES_STORAGE | 'django.contrib.staticfiles.storage.StaticFilesStorage' |
STATIC_ROOT | '/data/static_root' |
STATIC_URL | '/static/' |
SUPPORT | [''] |
TEMPLATES | [{'APP_DIRS': True, 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': ['/src/templates'], '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 | 'Africa/Casablanca' |
TWO_FACTOR_EMAIL_GATEWAY | 'custom_two_factor_auth.gateways.gateways.EmailGateway' |
USE_I18N | True |
USE_L10N | True |
USE_THOUSAND_SEPARATOR | False |
USE_TZ | True |
USE_X_FORWARDED_HOST | False |
USE_X_FORWARDED_PORT | False |
WSGI_APPLICATION | 'app.wsgi.application' |
X_FRAME_OPTIONS | 'SAMEORIGIN' |
YEAR_MONTH_FORMAT | 'F Y' |
You're seeing this error because you have DEBUG = True
in your
Django settings file. Change that to False
, and Django will
display a standard page generated by the handler for this status code.