Wednesday, June 29, 2011

Django "accounts/login/?next=..."


I'm in http://127.0.0.1:8000/en-US/msw/login and if login is successful, I make an HttpResponseRedirect() to the front page of my app, "/en-US/msw", but why is redirecting to http://127.0.0.1:8000/en-US/accounts/login/?next=/en-US/msw/ ??  Where does this "accounts/login" and parameter "next" come from? I have never defined them.

solution (thanks to andym and cvan):
"accounts/login" - is set as "LOGIN_URL" in settings.
"next" - is set in src/django/django/contrib/auth/views.py read more about it here.

3 comments:

  1. I am getting such problem on every url;

    when i try to open
    http://127.0.0.1:8000/movies/director/Bryan_Singer/ it always redirect to
    http://127.0.0.1:8000/accounts/login/?next=/movies/director/Bryan_Singer/

    ReplyDelete
  2. Please Help !! I am struck badly due to this fucking error

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete