добавил страницы ошибок 403 и 404, убрал вьюху для фавикона (потому что его отдает nginx)

This commit is contained in:
VladislavOstapov 2024-01-17 18:26:07 +03:00
parent 981ad1b286
commit feb18af30b
3 changed files with 24 additions and 1 deletions

View File

@ -23,5 +23,4 @@ urlpatterns = [
path('', include('index.urls')),
path('account/', include('users.urls')),
path('admin/', admin.site.urls),
path('favicon.ico', lambda req: serve(req, 'favicon.svg'))
]

12
templates/403.html Normal file
View File

@ -0,0 +1,12 @@
{% extends 'base.html' %}
{% load static %}
{% block title %} Отказано в доступе {% endblock %}
{% block header %}
<h1> {% if page_name %}{{ page_name }}{% else %}403 Forbidden{% endif %} </h1>
{% endblock %}
{% block content %}
<h2>Недостаточно прав для просмотра данной страницы</h2>
{% endblock %}

12
templates/404.html Normal file
View File

@ -0,0 +1,12 @@
{% extends 'base.html' %}
{% load static %}
{% block title %} Страница не найдена {% endblock %}
{% block header %}
<h1> {% if page_name %}{{ page_name }}{% else %}404 Not Found{% endif %} </h1>
{% endblock %}
{% block content %}
<h2>Страница не найдена</h2>
{% endblock %}