Skip to main content

This aims to be a powerful Django app to ease the integration of the popular Bootstrap UI framework (http://getbootstrap.com).

Project description

https://img.shields.io/travis/timorieber/django-bootstrap-ui.svg https://img.shields.io/coveralls/timorieber/django-bootstrap-ui/master.svg https://img.shields.io/pypi/v/django-bootstrap-ui.svg https://img.shields.io/pypi/l/django-bootstrap-ui.svg https://readthedocs.org/projects/django-bootstrap-ui/badge/

django-bootstrap-ui aims to be a powerful Django app to ease the integration of the popular Bootstrap UI framework. It is written in Python and built on the Django web framework.

The code is open source and released under the ISC License (ISCL). It is available on GitHub and follows the guidelines about Semantic Versioning for transparency within the release cycle and backward compatibility whenever possible.

Features

  • Full-featured Bootstrap 3 template (3.3.5)

  • Latest Font Awesome integration (4.3.0)

  • Ready-to-use Bootstrap component templates

  • Intuitive template tag API for generating valid Bootstrap markup

  • Extensive and up-to-date documentation

  • Mainstream Python (2.7, 3.3, 3.4) and Django (1.7, 1.8) support

  • Outstanding test coverage

  • Continuously integrated codebase

Installation

  1. First install the package using pip with the --pre option as long as this is a pre-release:

    pip install --pre django-bootstrap-ui
  2. Add bootstrap_ui to your INSTALLED_APPS setting:

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

Usage

Bootstrap template

Prepare your page for Bootstrap and provide your content:

  1. Extend bootstrap-skeleton.html in your base template:

    {% extends "bootstrap_ui/bootstrap-skeleton.html" %}
  2. Fill predefined blocks with your content:

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

Bootstrap component templates

Render complete Bootstrap components by including our default implementations. Example:

  1. Provide a list of strings ['alpha', 'beta', 'gamma'] as template variable items

  2. Include listgroup.html parameterized with type='list' and items=items:

    {% include 'bootstrap_ui/listgroup.html' with type='list' items=items only %}

Template tag API

Generate your own, customized Bootstrap elements using our template tags. Example:

  1. Load bootstrap_ui_tags in your template:

    {% load bootstrap_ui_tags %}
  2. Use Bootstrap components through intuitive template tags:

    {% listgroup %}
        {% listgroupitem %}
            Your raw text.
        {% endlistgroupitem %}
        {% listgroupitem %}
            You may also use a {{ context_variable }}.
        {% endlistgroupitem %}
    {% endlistgroup %}
  3. Some Bootstrap components support different html tags, to change the default add a parameter:

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

Continue reading in our detailed documentation at readthedocs.org.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-bootstrap-ui-0.1.0rc2.tar.gz (6.5 kB view hashes)

Uploaded Source

Built Distribution

django_bootstrap_ui-0.1.0rc2-py2.py3-none-any.whl (9.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page