Wednesday, October 30, 2013

Re: reauest.session[] not working.

I'll try that, but why does this work under windows and not ubuntu

On 30 Oct 2013 13:59, "Tom Evans" <tevans.uk@googlemail.com> wrote:
On Wed, Oct 30, 2013 at 1:44 PM, Nigel Legg <nigel.legg@gmail.com> wrote:
> My view:
>
> @login_required
> def list(request):
>     user = User.objects.get(pk=request.session['user.id'])

What is putting this 'user.id' key in the session? d.c.auth puts
"_auth_user_id" in the session (but if the 'user' is the logged in
user, why any of this, why not request.user?)

Cheers

Tom

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFHbX1%2BqLWiu2Q9aATFD9A7uM5ahkuE7CNJdNiQ%2BdwLqQwXYOg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CADeX7vw1QF6DXg5k0S0a-a%3DQgp7MQq0rY5GFEDD6K46rA-VRBg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment