Search code examples
djangodjango-rest-auth

I'm getting a DoesNotExist error with django rest auth password reset


I've installed and configured django-rest-auth, everything seems to be working properly except the /rest-auth/password/reset/ endpoint.

When I do a POST to it, passing the email via JSON, a 500 - DoesNotExist error is returned:

DoesNotExist at /rest-auth/password/reset/ Site matching query does not exist. Request Method: POST Request URL: http://.../rest-auth/password/reset/ Django Version: 1.9.5 Exception Type: DoesNotExist Exception Value: Site matching query does not exist. Exception Location: /home/.../.local/lib/python2.7/site-packages/django/db/models/query.py in get, line 387 Python Executable: /usr/bin/python Python Version: 2.7.10

What could be causing this?


Solution

  • django-allauth (used internally by DRA) looks for the domain name by searching for Site object.

    Please follow these steps to set up sites framework: https://docs.djangoproject.com/en/1.9/ref/contrib/sites/#enabling-the-sites-framework