djangomongodbpasswordsdjongo

Django password reset with MongoDB - DatabaseError with no exception message


I've connected my Django app with MongoDB, register/login/logout are all working fine. But when I use the Django default password reset email it throws a database error.

What I've tired:

I was able to land on the Django password reset page, but when I hit confirm it return the error on the browser

DatabaseError at /pw_reset/
No exception message supplied
Request Method: POST
Request URL:    http://localhost:8000/pw_reset/
Django Version: 3.2.6
Exception Type: DatabaseError
Exception Location:  
C:...venv\lib\site-packages\djongo\cursor.py, line 59, in execute

The above exception ( Keyword: None Sub SQL: None FAILED SQL: ('SELECT "accounts_user"."id", "accounts_user"."password", "accounts_user"."last_login", "accounts_user"."is_superuser", "accounts_user"."username", "accounts_user"."first_name", "accounts_user"."last_name", "accounts_user"."email", "accounts_user"."is_staff", "accounts_user"."is_active", "accounts_user"."date_joined" FROM "accounts_user" WHERE ("accounts_user"."email" iLIKE %(0)s AND "accounts_user"."is_active")',) Params: (('test@test.com',),) Version: 1.3.6) was the direct cause of the following exception:

Console log:

Traceback (most recent call last):
  File "C:...\lib\site-packages\django\template\base.py", line 850, in _resolve_lookup   
    (bit, current))  # missing attribute
django.template.base.VariableDoesNotExist: Failed lookup for key [name] in <URLResolver <URLPattern list> (admin:admin) 'admin/'>

URL Path:

path('pw_reset/', auth_views.PasswordResetView.as_view(), name="reset_password"),

The Views I defined myself (register/login/logout) are all working fine. But the built-in one PasswordRestView is not. I've tried dropping the DB, reinstall djongo, I run out of ideas... Please help!


Solution

  • Fixed by downgrading versions on:

    Django==3.0.5
    djongo==1.3.4
    sqlparse==0.2.4