python - NoReverseMatch 错误,尝试在 Django 中设置详细页面 View

标签 python django django-templates django-urls

我正在尝试设置一个详细页面,以便每次人们单击文章的链接时,都会将他们带到有关该文章的详细页面。我觉得错误出现在我的 urls.py 中的某个位置或我的 list.html 文件中的实际 url 中。

更新 #1 - 将 FullArticle_detailed 更改为 urls.py 中的详细内容 - 我收到 NoReverseMatch 错误提示,该错误突出显示了 list.html

中的第 26 行
Reverse for 'detailed' with arguments '()' and keyword arguments '{u'slug': ''}' not found. 1 pattern(s) tried: ['(?P<slug>\\S+)$']

这是错误的屏幕截图: enter image description here

这是我的 Sublime 的屏幕截图: enter image description here

最佳答案

网址名称不匹配:

在模板中您使用detailed,但在urls.py中有FullArticle_detailed

关于python - NoReverseMatch 错误,尝试在 Django 中设置详细页面 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27489340/

相关文章:

Python ttk 对象 - 不理解小部件特定的选项

python - Pip3 尝试安装在错误的 python 目录中

javascript - ajax html响应中的AngularJs数据绑定(bind)

python - Django 模板响应混合

django - 500.html 而不是 404.html

django - 在Django模板中访问元组

python - 如何使用 python 从 SNMP 获取数据?

python - Django - 如何为 values_list 中的每个元组添加一个值

javascript - 防止第三方调用内部 POST 方法

django - 在多个 django 模板中渲染表单函数