From f8796c6d04cd7073cfb62207fb1e996aab1c9f05 Mon Sep 17 00:00:00 2001 From: Hugo LEVY-FALK Date: Tue, 17 Jul 2018 00:34:27 +0200 Subject: [PATCH 1/2] Fix #24 : adds a 404 page. --- templates/404.html | 227 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 227 insertions(+) create mode 100644 templates/404.html diff --git a/templates/404.html b/templates/404.html new file mode 100644 index 00000000..fdf5ec77 --- /dev/null +++ b/templates/404.html @@ -0,0 +1,227 @@ +{% comment %} +Re2o est un logiciel d'administration développé initiallement au rezometz. Il +se veut agnostique au réseau considéré, de manière à être installable en +quelques clics. + +Copyright © 2018 Hugo Levy-Falk + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 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 General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +{% endcomment %} + +{% load i18n %} +{% load staticfiles %} + + + + + + + + + + + + + + + 404, Page not Found + + + + + +

{% trans "Yup, that's a 404 error."%} {% trans "(Go to a known place)"%}

+ + {%trans "Your browser does not support the HTML5 canvas tag."%} + + + + + From 8d6439f13ba97b5c08b59b1dfa75c7fa3223c29c Mon Sep 17 00:00:00 2001 From: Hugo LEVY-FALK Date: Fri, 20 Jul 2018 20:12:03 +0200 Subject: [PATCH 2/2] Regroupement avec l'erreur 500. --- re2o/urls.py | 1 + re2o/views.py | 5 +++++ templates/{ => errors}/404.html | 0 3 files changed, 6 insertions(+) rename templates/{ => errors}/404.html (100%) diff --git a/re2o/urls.py b/re2o/urls.py index 3322e82b..87a5b346 100644 --- a/re2o/urls.py +++ b/re2o/urls.py @@ -50,6 +50,7 @@ from django.contrib.auth import views as auth_views from .views import index, about_page handler500 = 're2o.views.handler500' +handler404 = 're2o.views.handler404' urlpatterns = [ url(r'^$', index, name='index'), diff --git a/re2o/views.py b/re2o/views.py index 3c5cde09..8d98d927 100644 --- a/re2o/views.py +++ b/re2o/views.py @@ -229,3 +229,8 @@ def about_page(request): def handler500(request): """The handler view for a 500 error""" return render(request, 'errors/500.html') + + +def handler404(request): + """The handler view for a 404 error""" + return render(request, 'errors/404.html') diff --git a/templates/404.html b/templates/errors/404.html similarity index 100% rename from templates/404.html rename to templates/errors/404.html