mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-02-03 13:14:28 +03:00
Fix for wsgi.py for Raven in dev
This commit is contained in:
parent
8be2f14cb4
commit
5fecdf8405
|
@ -20,7 +20,10 @@ from django.core.wsgi import get_wsgi_application
|
||||||
from whitenoise.django import DjangoWhiteNoise
|
from whitenoise.django import DjangoWhiteNoise
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{% if cookiecutter.use_sentry == "y" -%}
|
{% if cookiecutter.use_sentry == "y" -%}
|
||||||
|
if os.environ.get("DJANGO_SETTINGS_MODULE") == "config.settings.production":
|
||||||
from raven.contrib.django.raven_compat.middleware.wsgi import Sentry
|
from raven.contrib.django.raven_compat.middleware.wsgi import Sentry
|
||||||
|
else:
|
||||||
|
pass
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
|
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
|
||||||
|
@ -40,7 +43,10 @@ application = get_wsgi_application()
|
||||||
application = DjangoWhiteNoise(application)
|
application = DjangoWhiteNoise(application)
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{% if cookiecutter.use_sentry == "y" -%}
|
{% if cookiecutter.use_sentry == "y" -%}
|
||||||
|
if os.environ.get("DJANGO_SETTINGS_MODULE") == "config.settings.production":
|
||||||
application = Sentry(application)
|
application = Sentry(application)
|
||||||
|
else:
|
||||||
|
pass
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
# Apply WSGI middleware here.
|
# Apply WSGI middleware here.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user