[Django]-On Success URL redirect not working for custom view in django-allauth

3👍

In the default view if there is “next” field in the sign-in form the view, allauth will automatically redirect to it.

<input id="login_redirect" type="hidden" name="next" value="#" />

complete form

      <form method="POST" action="{% url "account_login" %}">
        {% csrf_token %}
        {{form}}
        <input  type="hidden" name="next" value="/add_account_select/" />
        <button type="submit" class="btn btn-primary">Sign IN</button>
      </form>

1👍

Just to provide an up-to-date answer:

Using django-allauth=0.30.0, the following works nicely in views.py

from allauth.account.views import SignupView


class LocaLSignupView(SignupView):
    success_url = '/page/to/redirect/to'
👤S.D.

Leave a comment