From 657bb11bbcb752af64e9dd21aa9e39b34eb8ee14 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 12 Jun 2014 23:20:49 +0530 Subject: [PATCH] Add Django custom error handling pages for 404 and 500 errors --- templates/404.html | 36 ++++++++++++++++++++++++++++++++++++ templates/500.html | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 templates/404.html create mode 100644 templates/500.html diff --git a/templates/404.html b/templates/404.html new file mode 100644 index 000000000..b4e9a30d1 --- /dev/null +++ b/templates/404.html @@ -0,0 +1,36 @@ +{% extends 'login_nav.html' %} +{% comment %} +# +# This file is part of Plinth. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +{% endcomment %} + +{% block title_block %} +404 +{% endblock %} + +{% block main_block %} + +

Requested page {{ request_path }} was not found.

+ +

If you believe this missing page should exist, please file a bug with either + the Plinth project (it + has an issue tracker) or the people responsible for the module you are + trying to access.

+ +

Sorry for the mistake.

+ +{% endblock %} diff --git a/templates/500.html b/templates/500.html new file mode 100644 index 000000000..485f3df3c --- /dev/null +++ b/templates/500.html @@ -0,0 +1,32 @@ +{% extends 'login_nav.html' %} +{% comment %} +# +# This file is part of Plinth. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +{% endcomment %} + +{% block title_block %} +500 +{% endblock %} + +{% block main_block %} + +

This is an internal error and not something you caused or can fix. Please + report the error on + the bug tracker so we + can fix it.

+ +{% endblock %}