python - 如何覆盖夹层评论表单?

标签 python django mezzanine

我正在使用:

Python 2.7
Django 1.6.11
Mezzanine 3.1.10

任何登录我的博客网站的人都可以设置博客文章评论表单的“名称”字段。我有隐藏此字段的想法,但找不到评论表单的模板。

有谁知道评论表单模板在哪里,或者有其他方法可以阻止用户设置评论的“名称”字段吗?

最佳答案

您可以尝试通过首先将相关模板复制到 static/templates 目录来更改模板。使用命令

./manage.py findstatic templates\something.html

确保您的静态文件目录已设置,然后检查

./manage.py findstatic templates\something.html

找到这两个文件,一个来自夹层,一个来自静态目录。

示例:

./manage.py findstatic css\bootstrap.css

Found 'css\bootstrap.css' here:
  C:\Python34\lib\site-packages\mezzanine\core\static\css\bootstrap.css
  c:\users\me\documents\mezz-project\mez\static\css\bootstrap.css

关于python - 如何覆盖夹层评论表单?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30017267/

相关文章:

Python Spacy错误: RuntimeError: Language not supported

python - Windows上本地django开发如何配置apache和mod_wsgi

javascript - 在模板中查找 key 失败

带有 anchor (#)参数的 Django 重定向()

python - 类型错误 : unsupported operand type(s) for -: 'str' and 'int'

python - 区分文件名和文件路径

django - Webfaction 夹层 ALLOWED_HOSTS 200 错误

django - 如何将带有给定 slug 的夹层页面包含到基本模板中?

django - 夹层404和500错误模板未覆盖

python - Pandas 数据帧 : difference between rolling and expanding function