Skip to content

Commit

Permalink
Merge branch 'master' of github.com:pydanny/cookiecutter-django
Browse files Browse the repository at this point in the history
  • Loading branch information
pydanny committed Dec 13, 2015
2 parents 4338227 + 761c716 commit 93e7530
Showing 1 changed file with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,27 @@ def ready(self):
{% 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)
from raven import Client as RavenClient
from raven.contrib.celery import register_signal as raven_register_signal

raven_client = RavenClient(dsn=settings.RAVEN_CONFIG['DSN'])
raven_register_signal(raven_client)
{%- endif %}

{% if cookiecutter.use_opbeat == "y" -%}
if hasattr(settings, 'OPBEAT'):
from opbeat.contrib.django.models import client as opbeat_client
from opbeat.contrib.django.models import logger as opbeat_logger
from opbeat.contrib.django.models import register_handlers as opbeat_register_handlers
from opbeat.contrib.celery import register_signal as opbeat_register_signal

try:
opbeat_register_signal(opbeat_client)
except Exception as e:
opbeat_logger.exception('Failed installing celery hook: %s' % e)

if 'opbeat.contrib.django' in settings.INSTALLED_APPS:
opbeat_register_handlers()
{%- endif %}


Expand Down

0 comments on commit 93e7530

Please sign in to comment.