python - 夹层 CMS 中如何定义页面实例的 slug?

标签 python django mezzanine

来自Mezzanine docs :

By default the template pages/page.html is used, but if a custom template exists it will be used instead. The check for a custom template will first check for a template with the same name as the Page instance’s slug, and if not then a template with a name derived from the subclass model’s name is checked for. So given the above example the templates pages/dr-seuss.html and pages/author.html would be checked for respectively.

问题是 Mezzanine CMS 从哪里获取页面实例的 slug?是来自title属性吗?

最佳答案

默认情况下,slug 是从 title 属性自动生成的,但也可以从页面管理的元数据部分的“URL”选项中手动设置。

关于python - 夹层 CMS 中如何定义页面实例的 slug?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39800065/

相关文章:

javascript - 如何从 ReactJS 网络应用程序向 Django API 发送 POST 请求?

python - Form.media 没有被注入(inject)到模板中

Heroku 上的 Django : customizing django. po

python - 在虚拟工作室上运行时出现 "Failed to find a kernelspec to use for ipykernel launch"错误

python - 如何在Python中显示EOF?/如何识别行?

python - flask-httpauth:get_password 装饰器是如何为 basic-auth 工作的?

asp.net - Sql Server数据->MySql + Django迁移

python - Pandas:按 value_count 获取匹配组的索引行

python - standard_init_linux.go :211: exec user process caused "no such file or directory"?

python - FutureWarning : `TemplateForHostMiddleware` is deprecated. 请升级到模板加载器