I am getting exactly this same issue when i don't use the built in login  
short cuts.

I too would be interested in the answer.

On Mon, 19 Mar 2007 08:11:08 -0000, mediumgrade <[EMAIL PROTECTED]>  
wrote:

>
> So, I am writing my first Django app that requires some form of
> authentication, and I have run into a bit of a snag:
>
> I authenticate the user via the 'django.contrib.auth.views.login' view
> using a login template like this:
>
> <code>
> {% block main_section %}
> <div class="content">
> <center>
> {% if form.has_errors %}
> <p>Your username and password didn't match. Please try again.</p>
> {% endif %}
> <h1>LoanCRM</h1>
> <form method="post" action=".">
> <table>
> <tr><td><label for="id_username">Username:</label></
> td><td>{{ form.username }}</td></tr>
> <tr><td><label for="id_password">Password:</label></
> td><td>{{ form.password }}</td></tr>
> </table>
> <br>
> <input type="submit" value="login" />
> <input type="hidden" name="next" value="/home" />
> </form>
> </center>
> </div>
> {% endblock %}
> </code>
>
> As you can see, this redirects the user to the URL "/home".
>
> "Home" is rendered using a template like this:
>
> <code>
>
> <div class="content">
> {% block contentbody %}
> {% if is_logged_in %}Thanks for logging in!{% else %}Please log in.{%
> endif %}
> {% endblock %}
> </div>
>
> </code>
>
> The login process seems to work just fine. If the password is
> incorrect, the login page will warn them. If the password is correct,
> the user proceeds to the "/home" URL.
>
> The problem is that once they are at the "/home" URL, the template
> does not show that the user is logged in. The "if is_logged_in" test
> fails.
>
> What could I be doing wrong?
>
>
> >



-- 
http://belfast.no-ip.info/
Get http://www.ubuntu.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-users@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to