Redirect user to dynamic url after login

448 views
Skip to first unread message

F.Pighi

unread,
Oct 11, 2008, 9:55:49 AM10/11/08
to Django users
Hi all, I'm a newbie and I'm having some trouble with the login
process.

I just want to redirect the user to /users/(?P<username>[^/]+)/profile
or just /users/(?P<username>[^/]+) after a successful login.

How can I do it? I tried using the default login view it seems I have
to use the LOGIN_REDIRECT_URL variable in the settings.py, but I don't
know how to specify a dynamic url.

Should I write my own custom login view or is there a way to
accomplish this even with the default one?

What am I missing here?

Thank you very much

Arnaud Delobelle

unread,
Oct 11, 2008, 1:07:31 PM10/11/08
to Django users
You can redirect to something like /logged_in, this view has access to
request.user so can redirect you to /users/username/

--
Arnaud

F.Pighi

unread,
Oct 11, 2008, 3:38:36 PM10/11/08
to Django users
On Oct 11, 7:07 pm, Arnaud Delobelle <arno...@googlemail.com> wrote:
> You can redirect to something like /logged_in, this view has access to
> request.user so can redirect you to /users/username/

Thank you for the tips. It worked :-)
Reply all
Reply to author
Forward
0 new messages