Skip to content
Snippets Groups Projects
Commit 246a39df authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Add in a custom template for the apply 404

parent 1acad723
No related branches found
No related tags found
No related merge requests found
from django.conf import settings
from django.urls import include, path
from .utils import views
from .users import urls as users_urls
from .dashboard import urls as dashboard_urls
......@@ -14,4 +16,13 @@ urlpatterns = [
path('hijack/', include('hijack.urls', 'hijack')),
]
if settings.DEBUG:
urlpatterns += [
# Add views for testing 404 and 500 templates
path('test404/', views.page_not_found),
]
urlpatterns += base_urlpatterns
handler404 = 'opentech.apply.utils.views.page_not_found'
default_app_config = 'opentech.apply.utils.app.UtilsConfig'
from django.apps import AppConfig
class UtilsConfig(AppConfig):
name = 'opentech.apply.utils'
label = 'apply_utils'
{% extends "base-apply.html" %}
{% load wagtailcore_tags wagtailsettings_tags %}
{% block title %}{{ settings.utils.SystemMessagesSettings.title_404 }}{% endblock %}
{% block body_class %}template-404{% endblock %}
{% block content %}
<div class="wrapper wrapper--small wrapper--inner-space-large">
<h1>{{ settings.utils.SystemMessagesSettings.title_404 }}</h1>
{{ settings.utils.SystemMessagesSettings.body_404|richtext }}
</div>
{% endblock %}
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.views import defaults
from django.views.generic import DetailView, View
from django.views.generic.detail import SingleObjectTemplateResponseMixin
from django.views.generic.edit import ModelFormMixin, ProcessFormView
def page_not_found(request, exception=None, template_name='apply/404.html'):
return defaults.page_not_found(request, exception, template_name)
@method_decorator(login_required, name='dispatch')
class ViewDispatcher(View):
admin_view: View = None
......
......@@ -73,6 +73,7 @@ INSTALLED_APPS = [
'opentech.apply.review',
'opentech.apply.determinations',
'opentech.apply.stream_forms',
'opentech.apply.utils',
'opentech.public.funds',
'opentech.public.home',
......
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