我收到 Django rest auth 密码重置的 DoesNotExist 错误

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

我已经安装并配置了 django-rest-auth,除了 /rest-auth/password/reset/ 端点之外,一切似乎都正常工作。

当我对它执行 POST 时,通过 JSON 传递电子邮件,返回 500 - DoesNotExist 错误:

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

可能是什么原因造成的?

django-allauth(DRA 内部使用)通过搜索 Site 对象来查找域名。

请按照以下步骤设置站点框架: https://docs.djangoproject.com/en/1.9/ref/contrib/sites/#enabling-the-sites-framework