From ecf2f1e338a2ad44cd718ecfaeb0bcecf079ff53 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Tue, 15 Oct 2013 11:35:22 +0200 Subject: [PATCH] Separate 404 page for mil site --- edumed/milurls.py | 1 + edumed/templates/404_mil.html | 14 ++++++++++++++ edumed/views.py | 3 +++ 3 files changed, 18 insertions(+) create mode 100644 edumed/templates/404_mil.html diff --git a/edumed/milurls.py b/edumed/milurls.py index c2f375a..5da79e1 100644 --- a/edumed/milurls.py +++ b/edumed/milurls.py @@ -7,5 +7,6 @@ urlpatterns = patterns('', url(r'^kompetencje/', include('curriculum.urls')), ) +handler404 = 'edumed.views.mil_404_view' diff --git a/edumed/templates/404_mil.html b/edumed/templates/404_mil.html new file mode 100644 index 0000000..bdc4f15 --- /dev/null +++ b/edumed/templates/404_mil.html @@ -0,0 +1,14 @@ +{% extends "base_mil.html" %} +{% load i18n %} + +{% block title %}{% trans "Page not found" %}{% endblock %} + +{% block body %} + +

{% trans "Page not found" %}

+ +

+ {% trans "The page you were looking for doesn't exist." %} +

+ +{% endblock %} diff --git a/edumed/views.py b/edumed/views.py index 7d4818d..3defe5b 100755 --- a/edumed/views.py +++ b/edumed/views.py @@ -1,6 +1,7 @@ import os.path from django.conf import settings from django.views.generic import TemplateView +from django.views.defaults import page_not_found from pybb.views import ProfileEditView from .forms import AvatarlessEditProfileForm @@ -18,6 +19,8 @@ class HomeView(TemplateView): class MILHomeView(TemplateView): template_name = 'base_mil.html' +def mil_404_view(request): + return page_not_found(request, '404_mil.html') class AvatarlessProfileEditView(ProfileEditView): form_class = AvatarlessEditProfileForm -- 2.20.1