gpt4 book ai didi

python - 在/rest-auth/registration/account-confirm-email处配置不正确

转载 作者:行者123 更新时间:2023-12-01 17:26:00 25 4
gpt4 key购买 nike

我正在使用django-rest-auth用于用户注册和验证电子邮件。当用户注册时,我能够成功发送电子邮件。但是,在电子邮件验证时,我收到此错误并带有以下回溯:

File "/Library/Python/2.7/site-packages/django/core/handlers/base.py" in get_response
111. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Library/Python/2.7/site-packages/django/views/generic/base.py" in view
69. return self.dispatch(request, *args, **kwargs)
File "/Library/Python/2.7/site-packages/django/views/generic/base.py" in dispatch
87. return handler(request, *args, **kwargs)
File "/Library/Python/2.7/site-packages/django/views/generic/base.py" in get
155. return self.render_to_response(context)
File "/Library/Python/2.7/site-packages/django/views/generic/base.py" in render_to_response
130. template=self.get_template_names(),
File "/Library/Python/2.7/site-packages/django/views/generic/base.py" in get_template_names
142. "TemplateResponseMixin requires either a definition of "

Exception Type: ImproperlyConfigured at /rest-auth/registration/account-confirm-email/vjohhnrf6xpkmn1jxbzaopdn0g79tdyofumeeuyuehcuja8slyz7nzq1idyifcqk/
Exception Value: TemplateResponseMixin requires either a definition of 'template_name' or an implementation of 'get_template_names()'

知道如何解决这个问题吗?

最佳答案

虽然里卡多的答案是正确的,但它并没有帮助我解决我的问题。这就是我需要为我的 master urls.py 做的事情:

from allauth.account.views import confirm_email
.....
url(r'^accounts-rest/registration/account-confirm-email/(?P<key>.+)/$', confirm_email, name='account_confirm_email'),

确保 url 规范的开头以您用于 allauth REST 调用的任何路径开头。

当然,上面是使用内置 View 处理确认。

关于python - 在/rest-auth/registration/account-confirm-email处配置不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29725369/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com