django - /accounts/register/get_success_url() 处的 Django 注册类型错误缺少 1 个必需的位置参数:“用户”
问题描述
在用户成功注册我的应用程序后,使用 Django 注册 redux 插件创建表单页面。但是,我TypeError at /accounts/register/
get_success_url() missing 1 required positional argument: 'user'
在完成注册后一直收到此错误。它应该重定向到具有以下方法中显示的表单的页面
from registration.backends.simple.views import RegistrationView
# my new reg view, subclassing RegistrationView from our plugin
class MyRegistrationView(RegistrationView):
def get_success_url(self, request, user):
# the named URL that we want to redirect to after
# successful registration
return ('registration_create_word')
这是网址路径
path('accounts/create_word/', views.create_word, name='registration_create_word'),
我试图将参数更改为只是user
我收到了相同的错误,但它丢失了self
。不知道我错过了什么。我发现了一个类似的问题(How to redirect users to a specific url after registration in django registration?)但是我仍然收到错误
任何帮助将不胜感激。
解决方案
推荐阅读
- apache-commons - 在 Android Studio 中重写没有 EXIF 数据的文件
- javascript - 有人可以解释节点/heroku/AWS/Firebase/Apache 之间的区别吗?
- database - 处理来自第三方集成的数据丢失
- python-3.x - 如何从图形中直观地缩放/删除 NaN/0
- java - java中的菜鸟:java语法
- excel - Excel 365 中的 VBA:XMLHTTP - 无法搜索是否存在多个 URL 字符串?
- pytorch - 给定输入矩阵和权重矩阵,我将如何手动应用 nn.conv1d?
- javascript - 在 Firebase 中查询数组映射时为空数组
- reactjs - 如何在 componentDidUpdate 中重新生成 createRefs?
- c# - 在字典中添加字典的 int 值