From: Radek Czajka Date: Tue, 18 May 2010 15:38:31 +0000 (+0200) Subject: 500 error page X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/7aaf5361e7b27567ee43bff98d44f9c66ab12943 500 error page --- diff --git a/wolnelektury/templates/500.html b/wolnelektury/templates/500.html index 964b905b4..117fbc2af 100644 --- a/wolnelektury/templates/500.html +++ b/wolnelektury/templates/500.html @@ -13,9 +13,7 @@

{% trans "Server error" %}

-

-{% trans "We are sorry for your inconvenience, but server error occured. We are working on fixing it as soon as possible. Meanwhile, please go to " %}{% trans "main page" %}. -

+{% trans "

The Wolnelektury.pl site is currently unavailable. Meanwhile, visit our blog.

Inform our administrators about the error.

" %} diff --git a/wolnelektury/urls.py b/wolnelektury/urls.py index a7cd45f43..b576a2710 100644 --- a/wolnelektury/urls.py +++ b/wolnelektury/urls.py @@ -55,3 +55,5 @@ if 'rosetta' in settings.INSTALLED_APPS: urlpatterns += patterns('', url(r'^rosetta/', include('rosetta.urls')), ) + +handler500 = 'views.server_error' diff --git a/wolnelektury/views.py b/wolnelektury/views.py new file mode 100644 index 000000000..d3a8192e8 --- /dev/null +++ b/wolnelektury/views.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- + +from django import http +from django.template import RequestContext, loader + +def server_error(request): + t = loader.get_template('500.html') + return http.HttpResponseServerError(t.render(RequestContext(request))) +