-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 David escribió: > Hello, > > Just wonder if anybody has met this. I modified LOGIN_REDIRECT_URL > from "accounts/profile" to 'accounts' but Django still re-directs to > "accounts/profile" after a user has logined successfully. If > LOGIN_REDIRECT_URL is the url for default re-directing, then why it > still comes the word "profile"? > > I tried to add that user's login name to the re-directed url but > failed. In 'django.contrib.auth.views.login', I added > "redirect_to = redirect_to + form.get_user()", however this had no > use. If I can append this user's userName to the url, then I can parse > the url and retrieve this user's information from database later. So > how to you add users' name to the url? > > Can anybody help me? Thanks so much. >
mmm, I can't imagine why LOGIN_REDIRECT_URL is not working for you. However you can also pass the url with a hidden field called 'next' in your login form. You don't need to parse anything to get the current logged in user, you have it available in request.user. I recommend you to read http://docs.djangoproject.com/en/dev/topics/auth/#authentication-in-web-requests Regards. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEAREIAAYFAkorJFwACgkQNHr4BkRe3pKMHgCfepvXlBzGUNH6bzcPG/NCFehf sqQAoKr5J22MScuUxXJKYNB7qVJ3soqu =KXCc -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

