On Tue, 2008-04-01 at 23:29 -0700, Brot wrote:
> Hello,
> 
> I have a problem with the development server. I don't know if this
> behavior is right or if there is a problem.
> I have a view which is triggered throught an url. In this view I use
> urllib2. If I start the view with the development server the process
> is never ends. But if I start the view with the apache environment
> there is no problem
> 
> def any_view(request)
>     import urllib2
>     req = urllib2.Request(url='http://localhost:8000/url/')
>     content = urllib2.urlopen(req).read()
>     ....
> 
> Is there a problem if I use/read a url and the current request isn't
> completed?

The development server is single-threaded. It serves at most one request
at a time. Since your view is running in that single thread, any new
requests to the server will be blocked until your view returns. Spot the
deadlock. :-)

Regards,
Malcolm

-- 
For every action there is an equal and opposite criticism. 
http://www.pointy-stick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to