我使用标准格式发送确认电子邮件: 从allauth.account.views将confirm_email导入allauthemailconfirmation
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^rest-auth/', include('rest_auth.urls')),
url(r'^accounts/', include('allauth.urls')),
url(r'^rest-auth/registration/account-confirm-email/(?P<key>\w+)/$', allauthemailconfirmation, name="account_confirm_email"),
url(r'^rest-auth/registration/', include('rest_auth.registration.urls')),
]
设置:
^{pr2}$我正确地收到了一封电子邮件,但当您尝试链接时:
ImproperlyConfigured at /rest-auth/registration/account-confirm-email/MTU:1bn1OD:dQ_mCYi6Zpr8h2aKS9J9BvNdDjA/
TemplateResponseMixin requires either a definition of 'template_name' or an implementation of 'get_template_names()'
我想我发现了你的问题。在
此url:
与此模式不匹配:
^{pr2}$但通过以下方式:
如果您查看
rest_auth.registration.urls
的源代码,您将看到以下代码:所以,您应该覆盖这个视图,否则您将得到错误,如下所述:https://github.com/Tivix/django-rest-auth/issues/20
您确实尝试过覆盖视图,但是您的匹配模式是错误的,:char导致它失败,所以让我们尝试类似的方法
相关部分是:(?P[-:\w]+)/$
相关问题 更多 >
编程相关推荐