Add django-sentry, remove debug-toolbar

This commit is contained in:
2011-05-30 21:17:57 +01:00
parent 62dd79097d
commit 1ec1f33693
4 changed files with 21 additions and 4 deletions

View File

@@ -3,7 +3,7 @@ import djcelery
# Debug settings # Debug settings
DEBUG = False DEBUG = False
TEMPLATE_DEBUG = DEBUG TEMPLATE_DEBUG = True
# Zone Settings # Zone Settings
TIME_ZONE = 'UTC' TIME_ZONE = 'UTC'
@@ -31,7 +31,6 @@ MIDDLEWARE_CLASSES = (
'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.messages.middleware.MessageMiddleware',
'sso.middleware.InactiveLogoutMiddleware', 'sso.middleware.InactiveLogoutMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware',
'pagination.middleware.PaginationMiddleware', 'pagination.middleware.PaginationMiddleware',
'sso.middleware.IGBMiddleware', 'sso.middleware.IGBMiddleware',
) )
@@ -62,11 +61,12 @@ INSTALLED_APPS = (
'django.contrib.sites', 'django.contrib.sites',
'django.contrib.humanize', 'django.contrib.humanize',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'sentry',
'sentry.client',
'south', 'south',
'piston', 'piston',
'djcelery', 'djcelery',
'registration', 'registration',
'debug_toolbar',
'pagination', 'pagination',
'eve_proxy', 'eve_proxy',
'eve_api', 'eve_api',

View File

@@ -1,10 +1,22 @@
import logging
from celery.signals import task_failure
from celery.decorators import task from celery.decorators import task
from sentry.client.handlers import SentryHandler
from eve_api.models import EVEAccount, EVEPlayerCorporation, EVEPlayerAlliance from eve_api.models import EVEAccount, EVEPlayerCorporation, EVEPlayerAlliance
from sso.models import ServiceAccount from sso.models import ServiceAccount
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.db.models import signals from django.db.models import signals
from utils import installed from utils import installed
# Add Sentry error logging for Celery
logger = logging.getLogger('task')
logger.addHandler(SentryHandler())
def process_failure_signal(exception, traceback, sender, task_id, signal, args, kwargs, einfo, **kw):
exc_info = (type(exception), exception, traceback)
logger.error('Celery job exception: %s(%s)' % (exception.__class__.__name__, exception), exc_info=exc_info,
extra={'data': {'task_id': task_id, 'sender': sender, 'args': args, 'kwargs': kwargs, }})
task_failure.connect(process_failure_signal)
# Signals that the tasks need to listen for # Signals that the tasks need to listen for
def eveapi_deleted(sender, instance, **kwargs): def eveapi_deleted(sender, instance, **kwargs):

View File

@@ -35,5 +35,10 @@ if installed('groups'):
(r'^groups/', include('groups.urls')), (r'^groups/', include('groups.urls')),
) )
if installed('sentry'):
urlpatterns += patterns('',
(r'^sentry/', include('sentry.web.urls')),
)
if settings.DEBUG: if settings.DEBUG:
urlpatterns += staticfiles_urlpatterns() urlpatterns += staticfiles_urlpatterns()

View File

@@ -8,9 +8,9 @@ xmlrpclib==1.0.1
South==0.7.3 South==0.7.3
fabric fabric
flup flup
django-debug-toolbar
simplejson simplejson
celery==2.2.6 celery==2.2.6
django-celery==2.2.4 django-celery==2.2.4
-e git+https://github.com/ericflo/django-pagination.git@47e7ec874cd7dddda5ed#egg=django-pagination -e git+https://github.com/ericflo/django-pagination.git@47e7ec874cd7dddda5ed#egg=django-pagination
xmpppy xmpppy
django-sentry