Hello,
I was following the chapter 12 of the django book and had a
redirect
problem after login. I cannot redirect to the page I want. I
found the
following trick from the Django user group, but it did not
work for
me. I was always taken to the /accounts/profile/ even with
your code.
Here is what I have in my login.html
<form action='.' method='post'>
<label for="username">User
name:</label>
<input type="text"
name="username" value=""
id="username">
<label
for="password">Password:</label>
<input type="password"
name="password" value=""
id="password">
<input type="submit"
value="login" />
<input type="hidden" name="next"
value="{% if next %}{}{%
else %}/{% endif %}">
<form action='.' method='post'>
I correctly set the value of the "next" hidden
field, but it did not
work. I am always taken to the /accounts/profile/ page.
Could someone
explain why?
Also, I don't understand what the last <form> tag is
for, either. Any
help would be greatly appreciated.
Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-users googlegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|