Django Comments 错误如下教程
我正在尝试将 Django 的评论应用程序集成到我的网站中,但没有成功。我一直在关注以下文档: Django comments
错误我得到的是:
渲染时捕获 ViewDoesNotExist:尝试在模块 FrontEnd.views 中搜索。错误是:“模块”对象没有属性“搜索”
在我看来,没有任何内容指涉及搜索的任何内容。评论安装中的某些内容导致了这种情况。实际失败的线路是。
<form action="{% comment_form_target %}" method="post">
comment_form_target 突出显示。
导致错误的代码:
{% load comments %}
{% get_comment_form for article as form %}
<form action="{% comment_form_target %}" method="post">
{{ form }}
</form>
从我在网上找到的内容来看,看起来我要么在Python 2.7中缺少一些库,要么我正在做循环导入?
I'm trying to integrate Django's comment app into my site but with no success. I've been following the documentation outlined at: Django comments
The error I'm getting is:
Caught ViewDoesNotExist while rendering: Tried search in module FrontEnd.views. Error was: 'module' object has no attribute 'search'
nothing in my views refers to anything involving search. Something in the comments install is causing this. The line that actually fails is.
<form action="{% comment_form_target %}" method="post">
comment_form_target is highlighted.
The code causing the error:
{% load comments %}
{% get_comment_form for article as form %}
<form action="{% comment_form_target %}" method="post">
{{ form }}
</form>
From what I've found online, it looks like i'm either missing some library in my Python 2.7 or i'm doing circular imports?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在
FrontEnd.views.py
中添加搜索视图并查看问题所在。我正在添加一个答案,以便我们可以很好地关闭此票证。
形式错误
错误是:当 django 尝试进行反向 url 查找并且 urls.py 文件包含损坏的视图时,会生成
Add a search view in
FrontEnd.views.py
and see what the problem is.I'm adding an answer so we can nicely close this ticket.
An error of the form
is generated when django tries to do reverse url lookups and the urls.py file contains a broken view.