From 7aaf5361e7b27567ee43bff98d44f9c66ab12943 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 18 May 2010 17:38:31 +0200 Subject: [PATCH] 500 error page --- wolnelektury/templates/500.html | 4 +--- wolnelektury/urls.py | 2 ++ wolnelektury/views.py | 9 +++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 wolnelektury/views.py 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))) + -- 2.20.1