Added django-sentry to monitor errors and store

This commit is contained in:
Roberto Rosario
2011-02-19 02:20:54 -04:00
parent 417a41bed0
commit 81c6b650c8
6 changed files with 37 additions and 7 deletions

View File

@@ -11,5 +11,10 @@
server problem.</p>
<p>Administrators have been notified, so check back later.</p>
{% if request.sentry.id %}
<p>If you need assistance, you may reference this error as
<strong>{{ request.sentry.id }}</strong>.</p>
{% endif %}
</body>
</html>

View File

@@ -13,3 +13,4 @@
* Apply default transformations to document before OCR
* Added unpaper to the OCR convertion pipe
* Added support for concurrent, queued OCR processing using celery
* Added sentry to monitor and store error for later debugging

View File

@@ -7,4 +7,4 @@ django-rosetta==0.5.6
wsgiref==0.1.2
celery==2.2.2
django-celery==2.2.2
django-sentry==1.6.0

View File

@@ -4,4 +4,4 @@ django-pagination==1.0.7
wsgiref==0.1.2
celery==2.2.2
django-celery==2.2.2
django-sentry==1.6.0

View File

@@ -15,12 +15,10 @@ PROJECT_NAME = 'mayan'
DEBUG = False
DEVELOPMENT = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
TEMPLATE_DEBUG = True
ADMINS = ()
SENTRY_ADMINS = ('root@localhost',)
MANAGERS = ADMINS
DATABASES = {
@@ -128,6 +126,12 @@ INSTALLED_APPS = (
'ocr',
'permissions',
'djcelery',
'indexer',
'paging',
'sentry',
'sentry.client',
'sentry.client.celery',
)
TEMPLATE_CONTEXT_PROCESSORS = (

20
urls.py
View File

@@ -1,6 +1,8 @@
from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
from django.conf.urls.defaults import *
from django.views.defaults import page_not_found, server_error
admin.autodiscover()
@@ -14,8 +16,24 @@ urlpatterns = patterns('',
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/', include(admin.site.urls)),
(r'^grappelli/', include('grappelli.urls')),
(r'^sentry/', include('sentry.urls')),
)
def handler500(request):
"""
500 error handler which includes ``request`` in the context.
Templates: `500.html`
Context: None
"""
from django.template import Context, loader
from django.http import HttpResponseServerError
t = loader.get_template('500.html') # You need to create a 500.html template.
return HttpResponseServerError(t.render(Context({
'request': request,
})))
if settings.DEVELOPMENT:
urlpatterns += patterns('',
(r'^%s-site_media/(?P<path>.*)$' % settings.PROJECT_NAME,
@@ -27,3 +45,5 @@ if settings.DEVELOPMENT:
urlpatterns += patterns('',
url(r'^rosetta/', include('rosetta.urls'), name='rosetta'),
)