Skip to main content
Help us improve Python packaging – donate today!

a simple form filter for using Django forms with Twitter Bootstrap

Project Description

Simple Twitter Bootstrap filter for Django forms. Extracted from the bootstrap theme for Pinax.

Quick Start

Include “django-forms-bootstrap” in your requirements file and “django_forms_bootstrap” in your INSTALLED APPS.

Make sure your template loader finders includes app directories.

To style forms, add the following to the top of your template

{% load bootstrap_tags %}

and include your form using something like the following markup:

<form>
    <legend>My Form</legend>
    {% csrf_token %}
    {{ form|as_bootstrap }}
    <div class="form-actions">
      <a href="#back" class="btn">Go back</a>
      <button type="submit" class="btn btn-primary">Save changes</button>
    </div>
</form>

Specifying form layouts

Bootstrap includes styles for four types of forms. To change the display of your form, add one of the following class attributes to your form tag:

Name Class Description
Vertical (default) .form-vertical Stacked, left-aligned labels over controls
Horizontal .form-horizontal Float left, right-aligned labels on same line as controls
Inline .form-inline Left-aligned label and inline-block controls for compact style
Search .form-search Extra-rounded text input for a typical search aesthetic

License & Attribution

Django Forms Bootstrap is released under the MIT license. It does not include any styles or scripts from the Twitter Bootstrap project.

Release history Release notifications

History Node

3.1.0

History Node

3.0.1

History Node

3.0.0

This version
History Node

2.0.3.post2

History Node

2.0.3.post1

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
django-forms-bootstrap-2.0.3.post2.tar.gz (4.7 kB) Copy SHA256 hash SHA256 Source None Aug 2, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page