这旨在成为一个强大的django应用程序,以简化流行的引导ui框架(http://getbootstrap.com)的集成。

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


https://img.shields.io/travis/texperience/django-bootstrap-ui.svg?branch=masterhttps://img.shields.io/coveralls/texperience/django-bootstrap-ui/master.svghttps://img.shields.io/pypi/v/django-bootstrap-ui.svghttps://img.shields.io/pypi/l/django-bootstrap-ui.svghttps://readthedocs.org/projects/django-bootstrap-ui/badge/?version=stable

django bootstrap ui旨在成为一个强大的django应用程序,以简化流行的Bootstrap UI framework的集成。它是用Python写成的,并建立在Django web framework上。

功能

  • 全功能引导3模板(3.3.7)
  • 最新字体Awesome集成(4.7.0)
  • 内置引导和Bootswatch主题(3.3.7)
  • 准备好使用引导组件模板
  • 生成有效引导标记的直观模板标记api
  • 大量最新文档
  • 主流python(2.7、3.3、3.4、3.5、3.6)和django(1.8、1.9、1.10、1.11)支持
  • 出色的测试覆盖率
  • 持续集成的代码库

技术要求

下面是当前支持的django和python组合列表:

#DjangoPython
11.82.7, 3.3, 3.4, 3.5
21.9, 1.102.7, 3.4, 3.5
31.112.7, 3.4, 3.5, 3.6

安装

  1. 首先使用pip

    安装包
    pip install django-bootstrap-ui
    
  2. bootstrap_ui添加到INSTALLED_APPS设置:

    INSTALLED_APPS=(...'bootstrap_ui',...)

用法

引导模板

准备引导页面并提供内容:

  1. 在基本模板中扩展bootstrap-skeleton.html

    {%extends"bootstrap_ui/bootstrap-skeleton.html"%}
  2. 用您的内容填充预定义的块:

    {%blockbody-content%}
        <h1>Hello, I'm using django-bootstrap-ui!</h1>
    {%endblock%}

主题

您可以使用引导或引导样本主题设置页面样式。为项目范围内的默认主题将DJANGO_BOOTSTRAP_UI_THEME设置为settings.py中的有效标识符:

# django-bootstrap-ui settingsDJANGO_BOOTSTRAP_UI_THEME='bootswatch-paper'

引导组件模板

通过包含我们的默认实现来呈现完整的引导组件。示例:

  1. 提供字符串列表['alpha', 'beta', 'gamma']作为模板变量items

  2. 包括用type='list'items=items参数化的listgroup.html

    {%include'bootstrap_ui/listgroup.html'withtype='list'items=itemsonly%}

模板标记api

使用我们的模板标记生成您自己的自定义引导元素。示例:

  1. 在模板中加载bootstrap_ui_tags

    {%loadbootstrap_ui_tags%}
  2. 通过直观的模板标记使用引导组件:

    {%listgroup%}{%listgroupitem%}
            Your raw text.
        {%endlistgroupitem%}{%listgroupitem%}
            You may also use a {{context_variable}}.
        {%endlistgroupitem%}{%endlistgroup%}
  3. 一些引导程序组件支持不同的HTML标记,若要更改默认值,请添加一个参数:

    {%listgroupuse_tag="div"%}
        ...
        Your list group content goes here.
        ...
    {%endlistgroup%}

继续阅读我们的detailed documentation,网址是readthedocs.org。

代码和贡献

代码是开源的,并在ISC License (ISCL)下发布。它在GitHub上可用,并遵循Semantic Versioning的指导原则,以便在发布周期内保持透明并尽可能向后兼容。

所有贡献都是受欢迎的,无论是bug报告、代码贡献和评论、文档或特性请求。

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

推荐PyPI第三方库


热门话题
java IntelliJ找不到依赖项选项卡   java向字符串数组string[]添加元素并在Junit中测试结果   如何在eclipse中获取活动java项目的名称   如何使用java在mysql中插入时间   java ArrayList更新了插入一行,但Jtable仍然没有刷新   如何在JavaSwing中命名坐标(点)   java Matcher/模式不打印   java错误地设置了arraylist   使用UsernamePasswordCredential提供程序的java列表Azure AD   java在HTTP请求中设置UTC时间   未加载事件:jquery完整日历Java集成   java Maven插件依赖项无法从内部repo解析依赖项   Maven更新重置Java版本   java如何向中添加图片。带有Apache POI XWPF的docx,但不指定其大小   Java最大函数递归