将 success_url 传递给激活
文档说:
``success_url``
The name of a URL pattern to redirect to on successful
acivation. This is optional; if not specified, this will be
obtained by calling the backend's
``post_activation_redirect()`` method.
我该怎么做?
Docs say :
``success_url``
The name of a URL pattern to redirect to on successful
acivation. This is optional; if not specified, this will be
obtained by calling the backend's
``post_activation_redirect()`` method.
How can I do it ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在 urls.py 中执行此操作,例如:
另一种方法是通过继承默认后端来创建自己的后端(比听起来更简单):
最简单的解决方案是仅命名django-registration 应使用
registration_activation_complete
的 URL 模式。请参阅 Django 文档中的命名 URL 模式 。You can do it in your
urls.py
, e.g.:The other approach is to create your own backend (which is simpler than it sounds) by inheriting from the default backend:
The easiest solution is to just name your URL pattern that django-registration should use
registration_activation_complete
. See Naming URL patterns in the Django docs.