django应用,实现主题化概念,灵活可配置。

django-template-theming的Python项目详细描述


https://travis-ci.org/wtayyeb/django-template-theming.svg?branch=master

安装

您可以使用pip:

安装最新的django模板主题版本
pip install django-template-theming

设置

注意:应将以下设置添加到项目文件settings.py中。

  1. 将“主题化”添加到INSTALLED_APPS

    INSTALLED_APPS += ( 'theming', )
    
    if using django-compressor make sure put theming before compressor
    
  2. 将“theming.middleware.themingMiddleware”添加到MIDDLEWARE_CLASSES

    MIDDLEWARE_CLASSES += ( 'theming.middleware.ThemingMiddleware', )
    
  3. 将“theming.template.loader”添加到TEMPLATE_LOADERS

    TEMPLATE_LOADERS += ( 'theming.template.Loader', )
    

用法

它应该在项目中创建一个文件夹themes,其结构如下:

django_project/
| -- themes/
    | -- default/  ** theme name
        | -- static/  ** will collected by `collectstatic` management command
        |   | -- styles/
        |   | -- scripts/
        |   | -- images/
        | -- templatefiles and folders

贡献

开发django模板主题化的工作在github进行,任何想法和贡献都是源源不断的。 https://github.com/wtayyeb/django-template-theming

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Cassandra DB的javascript查询结果   java定时器任务调度   java在TLS上实现LDAP   为什么在浏览器中滚动会使java小程序闪烁?   未使用轮询器和serviceactivator提取java pubsub消息   java风暴多线程问题   java计算平均成绩   java将字符串添加到另一个类的数组列表中   文件Java路径如何转换为例如InputStream   java更改JComboBox的字体颜色   java inthttp:具有可轮询请求通道的inboundgateway   使用继承在Java中运行swing Base和扩展windows   java ivysettings。xml:添加本地maven路径   java如何将参数自定义视图传递给activity类   java延迟加载无法在Hibernate中使用一对一映射   当文件以“file:/”开头时,Java无法识别该文件   需要java正则表达式帮助,使用反斜杠   片段中的java GWT参数