import os
import site

os.environ['CELERY_LOADER'] = 'django'

# Add the app dir to the python path so we can import manage.
wsgidir = os.path.dirname(__file__)
site.addsitedir(os.path.abspath(os.path.join(wsgidir, '../')))

# manage adds /apps, /lib, and /vendor to the Python path.
import manage

import django.core.handlers.wsgi
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
application = django.core.handlers.wsgi.WSGIHandler()

# vim: ft=python

@@ -26,17 +26,28 @@
 .environ
-%5B
+.setdefault(
 'CELERY_
@@ -53,19 +53,17 @@
 _LOADER'
-%5D =
+,
  'django
@@ -63,16 +63,130 @@
 'django'
+)%0A# NOTE: you can also set DJANGO_SETTINGS_MODULE in your environment to override%0A# the default value in manage.py
 %0A%0A# Add 
@@ -452,58 +452,8 @@
 sgi%0A
-os.environ%5B'DJANGO_SETTINGS_MODULE'%5D = 'settings'%0A
 appl

Make env vars less intrusive in WSGI