The request object is passed to the views in your views.py you have
mapped to in your urls.py

Do you understand the layout of a basic django project? A python
module is not executed to handle a request, but is imported at the
startup of the process and your view functions are called depending on
the URL.

On Thu, May 26, 2011 at 7:17 AM, MikeKJ <mike.jo...@paston.co.uk> wrote:
>
> I need to get the auth user id in a save method on a model so
>
> from django.contrib.auth.models import User
> user_id = request.user.id
>
>
> the error comes back as
>
> name 'request' is not defined
>
> Cheers
> --
> View this message in context: 
> http://old.nabble.com/where-is-%27request%27-as-in-from-x-import-y-tp31706142p31706142.html
> Sent from the django-users mailing list archive at Nabble.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 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>



-- 
Read my blog! I depend on your acceptance of my opinion! I am interesting!
http://techblog.ironfroggy.com/
Follow me if you're into that sort of thing: http://www.twitter.com/ironfroggy

-- 
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