#12737: Thread local settings ---------------------------+------------------------------------------------ Reporter: Kronuz | Owner: nobody Status: new | Milestone: Component: Uncategorized | Version: SVN Keywords: | Stage: Unreviewed Has_patch: 1 | ---------------------------+------------------------------------------------ Many times I'm in the need of modify (perhaps wrongly) the settings in django.conf.settings... assuming the setting being modified is set up on every request (such as it could be the LANGUAGE_CODE, from the session, the URL or a cookie... or the SITE_ID fro the URL, for dynamic hosting) in some middleware perhaps... then it shouldn't be as "bad" to do so... or could it? (or so I thought) when I started using django, something that was not obvious for me was that settings where shared among threads too... and after testing everything locally it worked fine, but when I tried my project in a system with Apache and multiprocess/multithreaded environment it had weird things happening some times...
After some time I realized settings where being modified by different threads during the same request, making my dynamic sites behave erratically and my languages change from here to there in mysterious ways. The attached patch allows settings to be local to the threads, making it safe to modify of certain settings in a per request basis. -- Ticket URL: <http://code.djangoproject.com/ticket/12737> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.