mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Add django-sentry, remove debug-toolbar
This commit is contained in:
@@ -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',
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user