这是文档:(对我来说不是很清楚)。 http://mezzanine.jupo.org/docs/content-architecture.html#page-templates
以下是dollydagr回答的问题: How to add a custom template page to mezzanine?
他/她提供的第三种方法很有意义,但我希望url slug magic能够工作而不是使用urls.py
。
如果我创建一个新的Mezzanine项目和一个名为theme
的应用程序。
在theme
文件夹中,我可以使用templates
和base.html
创建index.html
目录。
如果我现在转到管理员并创建一个名为blue
的新富文本页面。
我需要做些什么来获取blue.html
模板? (假设我目前只有base.html
和index.html
而没有其他内容。
我尝试了许多组合但没有成功。
更新(确实有效!):以下是获取网页自定义模板的最低步骤。
sudo pip install mezzanine
mezzanine-project myproject
cd myproject/
python manage.py createdb
python manage.py startapp theme
> Add the theme app to your installed apps in settings.py
mkdir theme/templates
mkdir theme/templates/pages
nano theme/templates/pages/blue.html
> Add text: This is the blue page
python manage.py runserver
> Go to admin (http://127.0.0.1/admin) and add top level page titled blue.
> Browse to http://127.0.0.1/blue
答案 0 :(得分:3)
使用文件名theme/templates/pages/blue.html
创建模板,它将用于包含blue
slug的页面。