On Aug 31, 8:47 pm, Mike <m...@tkachuk.name> wrote:
> Hi,
>
> I also would like to note that this code is not threadsafe - you can't
> use it with python threads because of unexpectable results, in case of
> mod_wsgi please use prefork daemon mode with threads=1

Provided you set WSGIApplicationGroup to %{GLOBAL} in mod_wsgi 2.X, or
instead use newer mod_wsgi 3.0, you could always use thread locals.
That way each thread would have its own connection.

You need to ensure main interpreter is used in mod_wsgi 2.X, as thread
locals weren't preserved beyond lifetime of request in sub
interpreters. This issue has been addressed in mod_wsgi 3.0.

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