Friday, June 28, 2013

standalone script to call a view

I am trying to write a standalone script that calls one of my views. I
can call the view, but I'm having a problem with proving what it
wants. One of the things the view needs is request.user, and that
looks like this:

(Pdb) type(request.user)
<class 'django.utils.functional.SimpleLazyObject'>
(Pdb) type(request)
<class 'django.core.handlers.wsgi.WSGIRequest'>

I'm trying to create the objects it needs by instantiating WSGIRequest
and SimpleLazyObject, but I'm having issues proving what they need,
and I'm just going deeper and deeper down the rabbit hole. Maybe I'm
going about this the wrong way.

Anyone ever done something like this and can give me some advise on
what the best way to achieve this is?


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
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment