[英]Django cannot find my inherited comment form
Am trying to modify the look of django comments template form on my site but in vain. 我试图修改Django评论模板表单在我的网站上的外观,但徒劳无功。
I have created a comments folder on my project template folder(myproject/template/comments/) and copied the form.html & preview.html from django/contrib/comments/template/comments/). 我已经在我的项目模板文件夹(myproject / template / comments /)上创建了一个注释文件夹,并从django / contrib / comments / template / comments /复制了form.html和preview.html 。
I have then modified my local comment form.html according to my needs. 然后,我根据需要修改了本地评论form.html。
On the template that i want to insert the comment i have added the following code 在我要插入评论的模板上,我添加了以下代码
<h2> Enter your comments </h2>
{% load comments %}
{% render_comment_form for myObject %}
When i call the form, the comment form never gets rendered, just a blank page with the title Enter your comments 当我调用表单时,评论表单永远不会呈现,只有标题为空白的页面输入您的评论
its like django is not seeing my local form, because when i try to insert some text in the local form.html i don't see anything?! 就像django没看到我的本地表单,因为当我尝试在本地form.html中插入一些文本时,我什么都没看到?
What am i missing 我想念什么
Gath 盖特
Is the path to your bespoke comments
templates in your settings.TEMPLATE_DIRS? 您的settings.TEMPLATE_DIRS中是否是定制
comments
模板的路径? If not, Django will fall back to the templates in the django.contrib.comments package. 如果没有,Django将退回到django.contrib.comments包中的模板。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.