Skip to content

Commit

Permalink
[Enhancement] add error 500 page
Browse files Browse the repository at this point in the history
  • Loading branch information
Sispheor committed May 2, 2023
1 parent 28b016e commit 4735c5f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Squest/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from django.contrib import admin
from django.shortcuts import redirect
from django.urls import path, include
from django.views.generic import TemplateView
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
from rest_framework import permissions
Expand Down Expand Up @@ -69,3 +70,10 @@
urlpatterns += [
path('metrics/', include('monitoring.urls')),
]

if settings.DEBUG:
urlpatterns += [
path("403.html", TemplateView.as_view(template_name="403.html"), name="403-test"),
path("404.html", TemplateView.as_view(template_name="404.html"), name="404-test"),
path("500.html", TemplateView.as_view(template_name="500.html"), name="500-test")
]
18 changes: 18 additions & 0 deletions templates/500.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends "base.html" %}

{% block content %}
<div class="content-wrapper">
<div class="content-header">
</div>
<section class="content">
<div class="error-page align-content-center">
<h2 class="headline text-danger text-center">500</h2>
<div class="error-content align-content-center">
<h3><i class="fas fa-exclamation-triangle text-danger"></i>Oops! Something went wrong.</h3>
<p>We will work on fixing that right away. Meanwhile, you may return to <a href={% url 'home' %}">homepage</a></p>
</div>
</div>
</section>
</div>

{% endblock %}

0 comments on commit 4735c5f

Please sign in to comment.