List Info

Thread: Cannot redirect after login




Cannot redirect after login
user name
2007-12-28 11:39:49
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-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Cannot redirect after login
user name
2007-12-28 13:48:51
> Also, I don't understand what the last <form> tag
is for, either. Any
> help would be greatly appreciated.
>
The last form tag is an error. It should be the closing form
tag

</form>

Fix that and see if your problem persists.

Michael Trier
blog.michaeltrier.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Cannot redirect after login
user name
2007-12-30 13:51:31
Thanks, Michael,

That solved the problem.

YJ

On Dec 28, 1:48 pm, Empty <mtr...gmail.com> wrote:
> > Also, I don't understand what the last
<form> tag is for, either. Any
> > help would be greatly appreciated.
>
> The last form tag is an error. It should be the closing
form tag
>
> </form>
>
> Fix that and see if your problem persists.
>
> Michael Trier
> blog.michaeltrier.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )