diff --git a/src/apps/pages/views.py b/src/apps/pages/views.py index 971909972..e73c276b4 100644 --- a/src/apps/pages/views.py +++ b/src/apps/pages/views.py @@ -8,6 +8,8 @@ from competitions.models import Competition, Submission, CompetitionParticipant from profiles.models import User +from django.shortcuts import render + class HomeView(TemplateView): template_name = 'pages/home.html' @@ -62,3 +64,8 @@ def get_context_data(self, *args, **kwargs): context = super().get_context_data(*args, **kwargs) context['submissions'] = qs[:250] return context + + +def page_not_found_view(request, exception): + print(request) + return render(request, '404.html', status=404) diff --git a/src/static/img/404.png b/src/static/img/404.png new file mode 100644 index 000000000..510337e88 Binary files /dev/null and b/src/static/img/404.png differ diff --git a/src/templates/404.html b/src/templates/404.html new file mode 100644 index 000000000..ce2b6a226 --- /dev/null +++ b/src/templates/404.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} + + +{% block content %} +
+ Could not find the page you requested.
+If you are the challenge organizer and this URL previously pointed to a valid competition and it is now missing please contact us at info@codabench.org for more information.
+If this is an error, please file a bug report. For more information about Codabench, check out the wiki.
+ Return to Home +