Wiadomość napisana w dniu 2008-09-16, o godz. 02:49, przez shravster: > Fork a new process from the view at the point where i need to perform > urlopen. > Create a pipe so that the child process can grab the write end to > wirte the results of urlopen and exit. > Meanwhile, the parent process performs all the DB lookups and misc. > operations. > Finally, before returning the response to the template use the read > end of the pipe to get the information from the child process and > render template. > > But, for some reason, I get a modpython error: > Mod_python error: "PythonHandler django.core.handlers.modpython" > > Traceback (most recent call last): > > File "/usr/lib64/python2.4/site-packages/mod_python/apache.py", line > 299, in HandlerDispatch > result = object(req) > > File "/usr/lib/python2.4/site-packages/django/core/handlers/ > modpython.py", line 177, in handler > return ModPythonHandler()(req) > > File "/usr/lib/python2.4/site-packages/django/core/handlers/ > modpython.py", line 154, in __call__ > response = middleware_method(request, response) > > File "/usr/lib/python2.4/site-packages/django/middleware/common.py", > line 59, in process_response > if response.status_code == 404: > > AttributeError: 'NoneType' object has no attribute 'status_code' > > Any ideas on how to process information in parallel from inside a > view?
I always use threads and queues for such tasks. And this works. -- We read Knuth so you don't have to. - Tim Peters Jarek Zgoda, R&D, Redefine [EMAIL PROTECTED] --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---