Fix for raven not being loaded on development

related to issue #302
This commit is contained in:
Anna Callahan 2015-10-11 14:10:39 -04:00
parent d022bc89f0
commit daedd6c4c3

View File

@ -4,10 +4,7 @@ import os
from celery import Celery
from django.apps import AppConfig
from django.conf import settings
{% if cookiecutter.use_sentry == "y" -%}
from raven import Client
from raven.contrib.celery import register_signal
{%- endif %}
if not settings.configured:
# set the default Django settings module for the 'celery' program.
@ -30,6 +27,8 @@ class CeleryConfig(AppConfig):
{% if cookiecutter.use_sentry == "y" -%}
if hasattr(settings, 'RAVEN_CONFIG'):
# Celery signal registration
from raven import Client
from raven.contrib.celery import register_signal
client = Client(dsn=settings.RAVEN_CONFIG['dsn'])
register_signal(client)
{%- endif %}