django auth_views.login and redirects

Posted by Zayatzz on Stack Overflow See other posts from Stack Overflow or by Zayatzz
Published on 2010-02-04T21:39:02Z Indexed on 2010/03/15 11:29 UTC
Read the original article Hit count: 454

Hello

I could not understand why after logging in from address:

http://localhost/en/accounts/login/?next=/en/test/

I get refirected to

http://localhost/accounts/profile/

So i ran search in django files and found that this address is the default LOGIN_REDIRECT_URL for django.

What i did not understand is why it gets redirected to there. I guessed, that my login form's post address should be :

/accounts/login/?next=/en/test/

instead of

/accounts/login/

I wrote it into template and it worked. But since the redirect url changes dynamically, how can i make this login post forms address change dynamically too? is there a templatetag for that or something?

Alan

© Stack Overflow or respective owner

Related posts about django

Related posts about django-authentication