Skip to content
Snippets Groups Projects
Commit e2f158bc authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Custom 404 error page (issue #21)

parent 5dd661c4
No related branches found
No related tags found
1 merge request!86Merge school-apps
......@@ -3,6 +3,7 @@ from . import views
urlpatterns = [
path('', views.index, name='dashboard'),
path('test/', views.test_notification, name='dashboard_test'),
path('test/', views.error_404, name='error_404'),
path('impress/', views.impress, name='impress')
]
......@@ -43,4 +43,8 @@ def test_notification(request):
@login_required
def impress(request):
return render(request, 'partials/impress.html')
return render(request, 'common/impress.html')
def error_404(request, exception):
return render(request, 'common/404.html')
......@@ -25,7 +25,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Provided by secure_settings
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = False
ALLOWED_HOSTS = [
'info.katharineum.de',
......
......@@ -18,6 +18,7 @@ from django.contrib import admin
from django.urls import path
from django.conf.urls.static import static
from django.conf import settings
from django.conf.urls import handler404
urlpatterns = [
#############
......@@ -50,3 +51,5 @@ urlpatterns = [
#########
path('admin/', admin.site.urls),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
handler404 = 'dashboard.views.error_404'
{% include 'partials/header.html' %}
<main>
<h3>Leider existiert diese Seite nicht. (Fehler 404)</h3>
<p class="flow-text">
Beim Aufrufen dieser Seite ist ein Fehler aufgetreten. Vermutlich existiert sie nicht. Wenn Sie der Meinung
sind, dass diese Seiten eigentlich existieren müsste, wenden Sie sich bitte an den <a
href="mailto:support@katharineum.de">Support</a>.
</p>
</main>
{% include 'partials/footer.html' %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment