吉普赛页
gipsy-pages的Python项目详细描述
安装
pip install gipsy-pages
或
git clone ssh://git@git.revsquare.com/seler/gipsy-pages
cd gipsy-pages
python setup.py install
或用于开发
git clone ssh://git@git.revsquare.com/seler/gipsy-pages
cd gipsy-pages
pip install -r requirements/dev.txt
python setup.py develop
用法
添加到需求gipsy-pages
、gipsy-sections
和其他使用的库:
'filebrowser','gipsy.sections','gipsy.pages','mptt','django_extensions',
列出页面和节的模板:
GIPSY_PAGES_PAGE_TEMPLATE_NAME_ARTICLE='pages/article.html'GIPSY_PAGES_PAGE_TEMPLATE_NAME_SIMPLE='pages/simple.html'GIPSY_PAGES_PAGE_TEMPLATE_NAME_CHOICES=((GIPSY_PAGES_PAGE_TEMPLATE_NAME_ARTICLE,'Article'),(GIPSY_PAGES_PAGE_TEMPLATE_NAME_SIMPLE,'Simple'),)GIPSY_SECTIONS_SECTION_TEMPLATE_NAME_TEXT='sections/text.html'GIPSY_SECTIONS_SECTION_TEMPLATE_NAME_IMAGE='sections/image.html'GIPSY_SECTIONS_SECTION_TEMPLATE_NAME_CHOICES=((GIPSY_SECTIONS_SECTION_TEMPLATE_NAME_TEXT,'Text'),(GIPSY_SECTIONS_SECTION_TEMPLATE_NAME_IMAGE,'Image'),)
向URL添加页面:
url(r'^',include('gipsy.pages.urls',namespace='pages')),# orurl(r'^pages/',include('gipsy.pages.urls',namespace='pages')),
然后运行迁移:
django-admin migrate