Django registration login redirection

authentication, django, django-1.5, django-registration, redirect

Solution

django login view is internally used by django-registration for login. And `login` view provided by django takes care of `next`.

I guess you are missing sending it from the template.

Do you have following line in `registration/login.html`?

<input name="next" type="hidden" value="{{next}}">

If not, then add it, and your issue should be fixed.

Problem

With django-registration, I have in settings.py: ``` LOGIN_REDIRECT_URL = '/' ``` When I'm trying to access a page (signed out) like `http://localhost:8000/surfboards/current/`, I'm redirected to `http://localhost:8000/accounts/login/?next=/surfboards/current/` In that case, if the `next` parameter is specified, I'd like to be after login successfully redirected to this page, and not to the default `LOGIN_REDIRECT_URL`. For now, I'm always redirected to `http://localhost:8000/`, which is what I want only if `next` isn't specified. Thanks,

Original source