Суть проблемы: не отрабатывает {% url ' about' %}
about.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>About</title>
<h1>{{title}}</h1>
<a href="{% url 'about' %}">About</a>
</head>
<body>
</body>
</html>
views.py:
from django.http import HttpResponse
from django.urls import *
from django.shortcuts import render
def about(request):
return render(request, 'lang/about.html')
urls.py приложения lang:
from django.urls import path
from . import views
app_name = 'lang'
urlpatterns = [
# представления поста
path('', views.index, name='home'),
path('about/', views.about, name='about'),
urls.py проекта:
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('lang.urls', namespace='lang')),
]
Код ошибки:
django.urls.exceptions.NoReverseMatch: Reverse for 'about' not found. 'about' is not a valid view function or pattern name.
[15/Oct/2023 17:53:17] "GET /about/ HTTP/1.1" 500 115745