The problem: I am setting up the "forgot password" functionality for my website but whenever it is triggered the webserver shuts down. (when I hit the "submit" it waits for a while and then exits the program, then I have to "runserver" again)
The URLS:
path('reset_password/',
auth_views.PasswordResetView.as_view(),
name="reset_password"),
path('reset_password_sent/',
auth_views.PasswordResetDoneView.as_view(),
name="password_reset_done"),
path('reset/<uidb64>/<token>/',
auth_views.PasswordResetConfirmView.as_view(),
name="password_reset_confirm"),
path('reset_password_complete/',
auth_views.PasswordResetCompleteView.as_view(),
name="password_reset_complete"),
Settings setup:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = '*******@gmail.com'
EMAIL_HOST_PASSWORD = *******'
Here are the logs, I tried to read them but I got no idea how to fix this error.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\VARDHAN\AppData\Local\Programs\Python\Python37\lib\site-packages\django\template\base.py", line 850, in resolve_lookup (bit, current)) # missing attribute django.template.base.VariableDoesNotExist: Failed lookup for key [is_nav_sidebar_enabled] in [{'True': True, 'False': False, 'None': None}, {'csrf_token': <SimpleLazyObject: <function csrf..get_val at 0x00000285F295D488>>, 'request': <WSGIRequest: GET '/reset_password/'>, 'user': <SimpleLazyObject: <function AuthenticationMiddleware.process_request.. at 0x00000285F2B482F0>>, 'perms': <django.contrib.auth.context_processors.PermWrapper object at 0x00000285F2A4EE10>, 'messages': <django.contrib.messages.storage.fallback.FallbackStorage object at 0x00000285F2B200F0>, 'DEFAULT_MESSAGE_LEVELS': {'DEBUG': 10, 'INFO': 20, 'SUCCESS': 25, 'WARNING': 30, 'ERROR': 40}}, {}, {'form': , 'view': <django.contrib.auth.views.PasswordResetView object at 0x00000285F2B201D0>, 'title': 'Password reset', 'LANGUAGE_CODE': 'en-us', 'LANGUAGE_BIDI': False}] "GET /reset_password/ HTTP/1.1" 200 1903 File C:\Users\VARDHAN\AppData\Local\Programs\Python\Python37\Lib\site-packages\django\conf\locale\en\formats.py first seen with mtime 1603131647.8355522 File C:\Users\VARDHAN\AppData\Local\Programs\Python\Python37\Lib\site-packages\django\conf\locale\en_init.py first seen with mtime 1603131647.8345575 File C:\Users\VARDHAN\AppData\Local\Programs\Python\Python37\Lib\site-packages\django\contrib\staticfiles\storage.py first seen with mtime 1603131653.6030731 (0.031) SELECT "auth_user"."id", "auth_user"."password", "auth_user"."last_login", "auth_user"."is_superuser", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name", "auth_user"."email", "auth_user"."is_staff", "auth_user"."is_active", "auth_user"."date_joined" FROM "auth_user" WHERE (UPPER("auth_user"."email"::text) = UPPER('######@gmail.com') AND "auth_user"."is_active"); args=('######@gmail.com',) File C:\Users\VARDHAN\AppData\Local\Programs\Python\Python37\Lib\site-packages\django\core\mail\backends\smtp.py first seen with mtime 1603131654.0612879 File C:\Users\VARDHAN\AppData\Local\Programs\Python\Python37\Lib\site-packages\django\core\mail\backends\base.py first seen with mtime 1603131654.0582974 File C:\Users\VARDHAN\AppData\Local\Programs\Python\Python37\Lib\smtplib.py first seen with mtime 1530052318.0 File C:\Users\VARDHAN\AppData\Local\Programs\Python\Python37\Lib\site-packages\django\contrib\sites\requests.py first seen with mtime 1603131652.143951 File C:\Users\VARDHAN\AppData\Local\Programs\Python\Python37\Lib\site-packages\django\core\mail\backends_init.py first seen with mtime 1603131654.0572996 "POST /reset_password/ HTTP/1.1" 302 0