A reusable Django application to quickly integrate the Bootstrap toolkit from Twitter.
JavaScript Python
Switch branches/tags
Nothing to show
Pull request Compare This branch is 18 commits ahead, 1 commit behind rbrady:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bootstrapped
docs
.gitignore
LICENSE
MANIFEST.in
README.rst
setup.py

README.rst

Django Bootstrapped

Bootstrapped is a reusable Django application to quickly integrate the Bootstrap toolkit from Twitter. It's a collection of the bootstrap toolkit files and template tags to display them.

This application depends on django.contrib.staticfiles.

No files from Twitter's Bootstrap toolkit have been modified and retain their Apache 2.0 license.

* Note: This app only works on Django 1.3 and newer.

Installation

pip install django-bootstrapped

Configuration

  1. Add the bootstrapped directory to your Python path.
  2. Ensure django.contrib.staticfiles is added to your INSTALLED_APPS setting.
  3. Ensure django.contrib.staticfiles is configured properly.
  4. Add bootstrapped to your INSTALLED_APPS setting.
  5. Run manage.py collectstatic to copy the Twitter Bootstrap toolkit files to your static directory.

Template Usage

Loading bootstrap

{% include "bootstrap/css.inc.html" %}
{% include "bootstrap/js.inc.html" %}

Output:

<link rel="stylesheet" type="text/css" href="/static/bootstrap/css/bootstrap.css">
<script src="/static/bootstrap/js/bootstrap.js" type="text/javascript"></script>

Loading bootstrap uncompressed

{% with dev=true %}
{% include "bootstrap/css.inc.html" %}
{% include "bootstrap/js.inc.html" %}
{% endif %}

Output:

<link rel="stylesheet" type="text/css" href="/static/bootstrap/css/bootstrap.min.css">
<script src="/static/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>

Loading LESS

{% bootstrap_less %}

Output:

<script src="/static/bootstrap/js/less-1.1.5.min.js" type="text/javascript"></script>