找不到 'surveydetails' 的反向。 'surveydetails' 不是有效的视图函数或模式名称

Reverse for 'surveydetails' not found. 'surveydetails' is not a valid view function or pattern name

我已经坚持了一段时间,似乎无法修复错误。我已经检查了代码一百次,但显然我遗漏了一些东西。我也安装了我的应用程序。

有人能看到我遗漏了什么吗?

views.py

 def survey_details(request, id=None):
     context = {}
     surveys = Survey.objects.get(id=id)
     context['survey'] = survey
     return render(request, 'surveydetails.html', context)

feedback.urls.py

path('details/<int:id>', views.survey_details, name="surveydetails"),

surveys.html

{% extends 'main.html' %}

{% block content%}

    <h1>Surveys</h1>
    <h2>list of {{title}} </h2>
    {% if surveys %}
        <ul>
            {% for survey in surveys %}
            <li>
                <a href="{% url 'feedback:surveydetails' %}">{{ survey.title }}</a>
            </li>
            {% endfor %}
        </ul>
    {% else %}
        <p>There are no surveys.</p>
    {% endif %}
{% endblock %}

surveydetails.html

{% extends 'main.html' %}

{% block content%}

    <h1>Surveys</h1>
    <h2>Detail page</h2>
    <h3>{{question.title}}</h3>
    <p>Details page of {{question.title}}</p>

{% endblock %}

此处您没有传递调查 ID。

{% for survey in surveys %}
   <li>
     <a href="{% url 'feedback:surveydetails' survey.id %}">{{ survey.title }}</a>
 </li>
{% endfor %}