Wednesday, November 20, 2013

Apache environment variables in Django 1.6

Hi,

I recently upgraded my Django application from 1.5 to 1.6. This
application runs on Apache with mod_wsgi. After upgrading, Django
seems unable to access environment variables set by Apache using
SetEnv and SetEnvIf. Using Django 1.5 I was able to access this using
the following recipe in wsgi.py:

---
import os

from django.core.wsgi import get_wsgi_application
_application = get_wsgi_application()

def application(environ, start_response):
os.environ['MY_SETTING'] = environ['MY_SETTING']
return _application(environ, start_response)
---

Then, in settings.py, I would access MY_SETTING using os.environ['MY_SETTING'].

Is this a bug that this no longer works in Django 1.6? Is there a
better way to access Apache environment variables?

Thanks

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CADhq2b5vxuURi4Zq%2B77dL2EAiDzyrA3C9RHwhiTK6dssAkEqYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate