Closed hvar90 closed 2 years ago
version 2.9
Django 3.2.14
python-3.9.13
when i want to reset the password using a link like this one (http://www.mywebsite.com/accounts/password/reset/confirm/MTI0MjU2/b8knkl-aa215957eedf43d3b5dc6006525a22eb/) and when the token is valid i got this error self.request.session[INTERNAL_RESET_SESSION_TOKEN] = token AttributeError: 'WSGIRequest' object has no attribute 'session'
but when the token has expired i do not get error
MIDDLEWARE_CLASSES = ( "django.middleware.security.SecurityMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.common.CommonMiddleware", "django.middleware.locale.LocaleMiddleware", "django.middleware.csrf.CsrfViewMiddleware", "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) INSTALLED_APPS = ( "django.contrib.admin", "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sessions", "django.contrib.messages", 'django.contrib.staticfiles', "django.contrib.sites", "django.contrib.humanize", "django.contrib.sitemaps", "registration", )
at=info method=GET path="/" host=www.talkfi.net request_id=5d897e1b-d803-4ef0-9fd7-7800dc667e29 fwd="191.156.145.151,172.70.54.177" dyno=web.1 connect=0ms service=21ms status=200 bytes=39562 protocol=http 2022-07-15T03:07:49.406641+00:00 app[web.1]: measure#nginx.service=0.019 request_id=5d897e1b-d803-4ef0-9fd7-7800dc667e29 2022-07-15T03:08:18.156518+00:00 app[web.1]: [2022-07-14 22:08:18 -0500] [20] [ERROR] Error handling request /accounts/password/reset/confirm/MTI0MjU2/b8knkl-aa215957eedf43d3b5dc6006525a22eb/ 2022-07-15T03:08:18.156537+00:00 app[web.1]: Traceback (most recent call last): 2022-07-15T03:08:18.156538+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner 2022-07-15T03:08:18.156539+00:00 app[web.1]: response = get_response(request) 2022-07-15T03:08:18.156539+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response 2022-07-15T03:08:18.156540+00:00 app[web.1]: response = wrapped_callback(request, *callback_args, **callback_kwargs) 2022-07-15T03:08:18.156540+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view 2022-07-15T03:08:18.156540+00:00 app[web.1]: return self.dispatch(request, *args, **kwargs) 2022-07-15T03:08:18.156541+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/utils/decorators.py", line 43, in _wrapper 2022-07-15T03:08:18.156541+00:00 app[web.1]: return bound_method(*args, **kwargs) 2022-07-15T03:08:18.156543+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/views/decorators/debug.py", line 89, in sensitive_post_parameters_wrapper 2022-07-15T03:08:18.156543+00:00 app[web.1]: return view(request, *args, **kwargs) 2022-07-15T03:08:18.156543+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/utils/decorators.py", line 43, in _wrapper 2022-07-15T03:08:18.156543+00:00 app[web.1]: return bound_method(*args, **kwargs) 2022-07-15T03:08:18.156543+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func 2022-07-15T03:08:18.156544+00:00 app[web.1]: response = view_func(request, *args, **kwargs) 2022-07-15T03:08:18.156544+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/contrib/auth/views.py", line 279, in dispatch 2022-07-15T03:08:18.156544+00:00 app[web.1]: self.request.session[INTERNAL_RESET_SESSION_TOKEN] = token 2022-07-15T03:08:18.156544+00:00 app[web.1]: AttributeError: 'WSGIRequest' object has no attribute 'session'
@hvar90 I believe this is an error with your Django configuration and not this application. The code path in the error is not part of the library. Does this help https://stackoverflow.com/a/39480337?
version 2.9
Django 3.2.14
python-3.9.13
when i want to reset the password using a link like this one (http://www.mywebsite.com/accounts/password/reset/confirm/MTI0MjU2/b8knkl-aa215957eedf43d3b5dc6006525a22eb/) and when the token is valid i got this error self.request.session[INTERNAL_RESET_SESSION_TOKEN] = token AttributeError: 'WSGIRequest' object has no attribute 'session'
but when the token has expired i do not get error
at=info method=GET path="/" host=www.talkfi.net request_id=5d897e1b-d803-4ef0-9fd7-7800dc667e29 fwd="191.156.145.151,172.70.54.177" dyno=web.1 connect=0ms service=21ms status=200 bytes=39562 protocol=http 2022-07-15T03:07:49.406641+00:00 app[web.1]: measure#nginx.service=0.019 request_id=5d897e1b-d803-4ef0-9fd7-7800dc667e29 2022-07-15T03:08:18.156518+00:00 app[web.1]: [2022-07-14 22:08:18 -0500] [20] [ERROR] Error handling request /accounts/password/reset/confirm/MTI0MjU2/b8knkl-aa215957eedf43d3b5dc6006525a22eb/ 2022-07-15T03:08:18.156537+00:00 app[web.1]: Traceback (most recent call last): 2022-07-15T03:08:18.156538+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner 2022-07-15T03:08:18.156539+00:00 app[web.1]: response = get_response(request) 2022-07-15T03:08:18.156539+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response 2022-07-15T03:08:18.156540+00:00 app[web.1]: response = wrapped_callback(request, *callback_args, **callback_kwargs) 2022-07-15T03:08:18.156540+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view 2022-07-15T03:08:18.156540+00:00 app[web.1]: return self.dispatch(request, *args, **kwargs) 2022-07-15T03:08:18.156541+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/utils/decorators.py", line 43, in _wrapper 2022-07-15T03:08:18.156541+00:00 app[web.1]: return bound_method(*args, **kwargs) 2022-07-15T03:08:18.156543+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/views/decorators/debug.py", line 89, in sensitive_post_parameters_wrapper 2022-07-15T03:08:18.156543+00:00 app[web.1]: return view(request, *args, **kwargs) 2022-07-15T03:08:18.156543+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/utils/decorators.py", line 43, in _wrapper 2022-07-15T03:08:18.156543+00:00 app[web.1]: return bound_method(*args, **kwargs) 2022-07-15T03:08:18.156543+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func 2022-07-15T03:08:18.156544+00:00 app[web.1]: response = view_func(request, *args, **kwargs) 2022-07-15T03:08:18.156544+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/contrib/auth/views.py", line 279, in dispatch 2022-07-15T03:08:18.156544+00:00 app[web.1]: self.request.session[INTERNAL_RESET_SESSION_TOKEN] = token 2022-07-15T03:08:18.156544+00:00 app[web.1]: AttributeError: 'WSGIRequest' object has no attribute 'session'