On Mon, Jun 15, 2009 at 4:35 PM, Joakim Hove <joakim.h...@gmail.com> wrote:

>
> Hello,
>
> I have just started experimenting with the Django user authentication
> system, I am currently only running with the Python testserver (if
> that matters). In my url.py file I have the following view mapping:
>
> ...
> (r'^agent/$'  ,   'Sleipner.model.views.agent'),
> .....
>
> This view looks like this:
>
>
> def agent(request):
>     if not request.user.is_authenticated():
>         return HttpResponseRedirect('/Sleipner/login/?next=%s' %
> request.path)
>     else:
>         return render_to_response("model/agent.html" , {"username" :
> request.user.username})
>
>
> I.e. if the current request does not come from a authenticated user
> the view should redirect to a page querying for login info, otherwise
> it should render a simple page which displays the username of the
> currently logged in (authenticated) user. Now, what I do not
> understand is that the agent() function above always seems to execute
> the second code branch, i.e. it renders a welcome message to the
> agent, with a valid username, without me ever logging in? It ssems a
> user is automatically logged in - without any effort on my behalf.
>
> The logout() function also fails with "maximum recursion depth
> exceeded" - which might indicate some auto-login behaviour?
>
> Any tips greatly appreciated!
>
> Joakim
>
> >
>
Did you log yourself in in the admin without thinking about it?  That's
usually how I end up logged in without realizing it.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to