get_success_url() takes exactly 3 arguments (2 given)

后端 未结 3 898
执念已碎
执念已碎 2021-01-28 05:58

every one ,, I am using

django-registration-redux (1.4)

for my django registration(django 1.8),,however ,,when never I registered th

3条回答
  •  天命终不由人
    2021-01-28 06:54

    The get_success_url method does not take request as an argument. Remove it.

    class MyRegistrationView(RegistrationView):
        def get_success_url(self, user):
            # the named URL that we want to redirect to after # successful registration
            return ('home') 
    

    In this case, since you always redirect to the home view, you could set success_url instead:

    class MyRegistrationView(RegistrationView):
        success_url = 'home'
    

提交回复
热议问题