Merge pull request #332 from yunti/missing-raven-local

Fix for wsgi.py for Raven in dev
This commit is contained in:
Daniel Greenfeld 2015-09-17 12:18:28 -07:00
commit f296f96a96

View File

@ -20,7 +20,10 @@ from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise
{%- endif %}
{% if cookiecutter.use_sentry == "y" -%}
from raven.contrib.django.raven_compat.middleware.wsgi import Sentry
if os.environ.get("DJANGO_SETTINGS_MODULE") == "config.settings.production":
from raven.contrib.django.raven_compat.middleware.wsgi import Sentry
else:
pass
{%- endif %}
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
@ -40,7 +43,10 @@ application = get_wsgi_application()
application = DjangoWhiteNoise(application)
{%- endif %}
{% if cookiecutter.use_sentry == "y" -%}
application = Sentry(application)
if os.environ.get("DJANGO_SETTINGS_MODULE") == "config.settings.production":
application = Sentry(application)
else:
pass
{%- endif %}
# Apply WSGI middleware here.