Add Error 500 template and a small testing view for Debug.

This commit is contained in:
2013-04-05 10:21:51 +01:00
parent 412ff67510
commit 1839fa2014
3 changed files with 36 additions and 0 deletions

View File

@@ -2,6 +2,10 @@ from .base import *
DEBUG = False
MIDDLEWARE_CLASSES += [
'raven.contrib.django.raven_compat.middleware.SentryResponseErrorIdMiddleware',
]
AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
AWS_STORAGE_BUCKET_NAME = os.environ.get('AWS_STORAGE_BUCKET_NAME', 'vapemap-static')

View File

@@ -0,0 +1,26 @@
{% extends "base.html" %}
{% block style %}
<style type="text/css">
#site-error {
text-align: center;
}
#site-error h1 {
font-size: 70px;
line-height: 70px;
}
</style>
{% endblock %}
{% block content %}
<div class="row-fluid">
<div id="site-error" class="span12">
<h1>Oops</h1>
<p>It seems we hit a error serving your request. This may be a temporary error, so please try again in a minute or so.</p>
{% if request.sentry %}
<p>If you've hit the same issue more than once, please consider using the Feedback tab and informing us what steps you took to produce this error, citing {{ request.sentry.id }} as the Error ID code.</p>
{% endif %}
</div>
</div>
{% endblock %}

View File

@@ -1,3 +1,4 @@
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
@@ -12,3 +13,8 @@ urlpatterns = patterns('',
)
urlpatterns += staticfiles_urlpatterns()
if settings.DEBUG:
urlpatterns += patterns('',
(r'^500/$', 'django.views.defaults.server_error'),
)