Friday, June 28, 2013

Re: standalone script to call a view

View is used for serving  web requests not  for  serving bash script .  Ok you have called a view and receive a http page. Ia it expected result?
 I think more  easy way is create a function  which is be called by view and your script.

Many thanks,

Serge


+380 636150445
skype: skhohlov


On Fri, Jun 28, 2013 at 3:41 PM, Larry Martell <larry.martell@gmail.com> wrote:
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?

Thanks!
-larry

--
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.
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.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment