помогите пожалуйста с настройкой приложения. Я никак не могу разобраться, что нужно сделать. Это сама ошибка:
Internal Server Error: /
Traceback (most recent call last):
File "E:\PycharmProjects\django_project\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "E:\PycharmProjects\django_project\venv\lib\site-packages\django\core\handlers\base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "E:\PycharmProjects\django_project\venv\lib\site-packages\django\core\handlers\base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "E:\PycharmProjects\django_project\learning_logs\views.py", line 7, in index
return render(request, 'index.html')
File "E:\PycharmProjects\django_project\venv\lib\site-packages\django\shortcuts.py", line 19, in render
content = loader.render_to_string(template_name, context, request, using=using)
File "E:\PycharmProjects\django_project\venv\lib\site-packages\django\template\loader.py", line 62, in render_to_string
return template.render(context, request)
File "E:\PycharmProjects\django_project\venv\lib\site-packages\django\template\backends\django.py", line 61, in render
return self.template.render(context)
File "E:\PycharmProjects\django_project\venv\lib\site-packages\django\template\base.py", line 171, in render
return self._render(context)
File "E:\PycharmProjects\django_project\venv\lib\site-packages\django\template\base.py", line 163, in _render
return self.nodelist.render(context)
File "E:\PycharmProjects\django_project\venv\lib\site-packages\django\template\base.py", line 936, in render
bit = node.render_annotated(context)
File "E:\PycharmProjects\django_project\venv\lib\site-packages\django\template\base.py", line 903, in render_annotated
return self.render(context)
File "E:\PycharmProjects\django_project\venv\lib\site-packages\django\template\loader_tags.py", line 150, in render
return compiled_parent._render(context)
File "E:\PycharmProjects\django_project\venv\lib\site-packages\django\template\base.py", line 163, in _render
return self.nodelist.render(context)
File "E:\PycharmProjects\django_project\venv\lib\site-packages\django\template\base.py", line 936, in render
bit = node.render_annotated(context)
File "E:\PycharmProjects\django_project\venv\lib\site-packages\django\template\base.py", line 903, in render_annotated
return self.render(context)
File "E:\PycharmProjects\django_project\venv\lib\site-packages\django\template\defaulttags.py", line 443, in render
url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app)
File "E:\PycharmProjects\django_project\venv\lib\site-packages\django\urls\base.py", line 87, in reverse
return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
File "E:\PycharmProjects\django_project\venv\lib\site-packages\django\urls\resolvers.py", line 677, in _reverse_with_prefix
raise NoReverseMatch(msg)
django.urls.exceptions.NoReverseMatch: Reverse for 'topics' not found. 'topics' is not a valid view function or pattern name.
urls.py
from django.urls import path
from . import views
app_name = 'learning_logs'
urlpatterns = (
path('', views.index, name='index'),
path('topics/<int:topic_id>', views.topic, name='topic')
)
views.py
from django.shortcuts import render
from .models import Topic
def index(request):
return render(request, 'index.html')
def topic(request, topic_id):
topic = Topic.objects.get(id=topic_id)
entries = topic.entry_set.order_by('-date_added')
context = {'topic': topic, 'entries': entries}
return render(request, 'topic.html', context)
Ну и файл, который выдаёт ошибку base.html
<P>
<a href="{% url 'learning_logs:index' %}">Learning Log</a>
<a href="{% url 'learning_logs:topics' %}">Topics</a>
</P>
{% block content %}{% endblock content %}