custom 404 page
This commit is contained in:
@@ -18,6 +18,8 @@ from django.contrib import admin
|
||||
from django.conf.urls.static import static
|
||||
from django.conf import settings
|
||||
|
||||
from .views import error_404
|
||||
|
||||
urlpatterns = static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
|
||||
urlpatterns += [
|
||||
@@ -28,5 +30,7 @@ urlpatterns += [
|
||||
namespace='datenbank')),
|
||||
url(r'^admin/', include(admin.site.urls)),
|
||||
url(r'^captcha/', include('captcha.urls')),
|
||||
url(r'^', include('startpage.urls', namespace='startpage', app_name='startpage'))
|
||||
url(r'^', include('startpage.urls', namespace='startpage', app_name='startpage')),
|
||||
]
|
||||
|
||||
handler404 = error_404
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
from django.template.loader import render_to_string
|
||||
from django.http import HttpResponseNotFound
|
||||
|
||||
|
||||
def error_404(request):
|
||||
return HttpResponseNotFound(render_to_string('404.html'))
|
||||
@@ -0,0 +1,6 @@
|
||||
{% extends "public/default.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Huch? Wo willst du denn hin?</h1>
|
||||
<p><a href="{% url "startpage:index" %}">Hier</a> geht es zurück zur Startseite.</p>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user