1

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

当我对其进行 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

这可能是什么原因造成的?

4

1 回答 1

2

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

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

于 2016-04-18T09:46:21.937 回答