对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”的
主题参数。
============
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”的
主题参数。