如何准确地、一步一步地安装夹层主题?
例如,Moderna free theme .
最佳答案
先决条件:
0) 版本控制
Python 2.7.6.
Django 1.6.10
Mezzanine 3.1.10
Moderna v.? (static content)
1) 我用过 PythonAnywhere用于托管
2)我按照这种方式安装Mezzanine:here , 在底部有指向 PythonAnywhere 特定指南的链接
3) 所以,初始状态是:Mezzanine 已部署,空的,默认主题。
4) [可选] 收集了基本模板(原来是其中的约 80 个)
5) 通过
python manage.py collectstatic
收集静态信息1. 将 Moderna 添加到项目
这是一个简单的步骤。
mezzanine-project myproject
创建的那个)myproject/
+-deploy/
+-static/
+-templates/ [in case you chose to collect them]
+-moderna/ [our new theme]
|
+-__init__.py
+-settings.py
+-urls.py
+-manage.py
+-wsgi.py
|
+-[some other things]
2.更改settings.py
TEMPLATE_DIRS = (
os.path.join(PROJECT_ROOT, "moderna/templates"),
os.path.join(PROJECT_ROOT, "templates"),
)
3.新增静态文件
4. URLConf
urlpatterns += patterns('',
url("^$", direct_to_template, {"template": "index.html"}, name="home"),
("^", include("mezzanine.urls")),
...
5.重新加载
我猜有些服务器会自动选择新的设置和网址。那些不应该手动重新加载以 catch 并开始展示您美丽的新主题。
6.定制开始
base.html
开始自定义 Moderna 主题和 index.html
myproject/moderna/templates/
中的文件文件夹。 后记
我欢迎任何更正和扩展,我不是夹层定制方面的专家,并且该主题有很多滑坡。
关于themes - 如何部署 : Installing Mezzanine Theme,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28024595/