对django的引导主题支持。

django-bootstrap-themes的Python项目详细描述


django bootstrap主题
============


django的bootstrap主题支持,包括bootswatch中的主题。

*bootstrap(http://getbootstrap.com/)
*bootswatch(http://bootswatch.com/)

安装
----


``shell
`pip install django bootstrap themes
```

在您的django项目中。


其他应用程序

```

您可以使用模板
标记来获取用于引导的css和js文件:

*加载模板标记对于样式表)

``django
{%bootstrap\u styles theme='default'type='min.css'%}
{%bootstrap\u styles theme='cosmo'type='css'%}
{%bootstrap\u styles theme='united'type='less'%}
````

*获取javascript文件(选择是否使用
`use\min'参数进行缩小)

``django
{%bootstrap_script use_min=true%}
```


有一个方便的
函数可以将包含的主题列表作为
a`charfield`的“选项”列表返回,例如:


``python
from django.db import models
from bootstrap\u themes import list\u themes

class mymodel(models.model):
theme=models.charfield(最大长度=255,默认值='default',choices=list_themes())
```

>然后在模板中,可以使用“theme”字段的值作为“bootstrap_styles”的
主题参数。

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

推荐PyPI第三方库


热门话题
ApplyTransfermListener。Marklogic Java客户端Api中的ApplyResult?   java安卓:如何从服务调用方法   java如何在Junit中测试Servlet3.0注释基础servlet和嵌入Tomcat7   java在JSF中嵌入portlet   java检查多个向量是否是回文的?   Selenium Java页面对象模型查询   Java中运算符的优先级   java从包含透明像素的图像创建自定义JButton   hibernate Java类变量与其他变量的声明   安卓错误:任务执行失败:应用程序:mergeDebugResources'>JAVAlang.OutOfMemoryError:无法创建新的本机线程   java从localhost运行portlet   当用户输入索引时打印数组元素的java程序   在Windows 10上运行时出现java Blazegraph错误   javascript-spring有条件地加载资源