From: Aleksander Ɓukasz Date: Tue, 15 Oct 2013 09:35:22 +0000 (+0200) Subject: Separate 404 page for mil site X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/ecf2f1e338a2ad44cd718ecfaeb0bcecf079ff53 Separate 404 page for mil site --- 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