[Fixed]-Redirect back after login django-registration-redux

1👍

You could use next :

<form class="navbar-form" method="POST" action="{{ login_url }}?next={{request.path}}">

This will add a GET request to your form that points back to the current page.

For request.path to work you have to define template context processors in your settings.py

TEMPLATE_CONTEXT_PROCESSORS = (
    "django.core.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.media",
    "django.core.context_processors.request",
)

Leave a comment