Separate 404 page for mil site
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 15 Oct 2013 09:35:22 +0000 (11:35 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 22 Oct 2013 07:49:52 +0000 (09:49 +0200)
edumed/milurls.py
edumed/templates/404_mil.html [new file with mode: 0644]
edumed/views.py

index c2f375a..5da79e1 100644 (file)
@@ -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 (file)
index 0000000..bdc4f15
--- /dev/null
@@ -0,0 +1,14 @@
+{% extends "base_mil.html" %}
+{% load i18n %}
+
+{% block title %}{% trans "Page not found" %}{% endblock %}
+
+{% block body %}
+
+<h1>{% trans "Page not found" %}</h1>
+
+<p class="notice">
+    {% trans "The page you were looking for doesn't exist." %}
+</p>
+
+{% endblock %}
index 7d4818d..3defe5b 100755 (executable)
@@ -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