Render Django forms as described using the twitter bootstrap HTML layout
Project description
# Django Twitter Bootstrap Form
Render Django forms using the HTML described by the [Bootstrap 3](http://getbootstrap.com/css/#forms).
## Demo
A basic demo is availaible on this [sandbox](http://django-sandbox.geelweb.org/twitter-bootstrap-form)
## Installation
From PyPI
pip install django-twitterbootstrap-form
From Source:
python setup.py install
### About Bootstrap 2
You can install the 0.2 version of this lib if you still work with old versions
of [Twitter Bootstrap](http://twitter.github.com/bootstrap/base-css.html#forms)
From PyPI
pip install django-twitterbootstrap-form==0.2
From Source:
git checkout 0.2
python setup.py install
## Requirements
* Django>=1.4
* django-widget-tweaks==1.3
## Configuration
### settings.py
Edit your settings.py file and add the following line into your INSTALLED_APPS
'geelweb.django.twitter_bootstrap_form'
### HTML templates
Load the filters and use them
{% load twitter_bootstrap %}
Default form
<form role="form">
{{ default_form|twitter_bootstrap }}
<button type="submit" class="btn btn-default">Submit</button>
</form>
Search form / Navbar form
<form role="search" class="navbar-form">
{{ search_form|twitter_bootstrap:"search" }}
<button type="submit" class="btn btn-default">Search</button>
</form>
Inline form
<form role="form" class="form-inline">
{{ inline_form|twitter_bootstrap:"inline" }}
<button type="submit" class="btn btn-default">Sign in</button>
</form>
Horizontal form
<form role="form" class="form-horizontal">
{{ horizontal_form|twitter_bootstrap:"horizontal" }}
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-default">Sign in</button>
</div>
</div>
</form>
Render Django forms using the HTML described by the [Bootstrap 3](http://getbootstrap.com/css/#forms).
## Demo
A basic demo is availaible on this [sandbox](http://django-sandbox.geelweb.org/twitter-bootstrap-form)
## Installation
From PyPI
pip install django-twitterbootstrap-form
From Source:
python setup.py install
### About Bootstrap 2
You can install the 0.2 version of this lib if you still work with old versions
of [Twitter Bootstrap](http://twitter.github.com/bootstrap/base-css.html#forms)
From PyPI
pip install django-twitterbootstrap-form==0.2
From Source:
git checkout 0.2
python setup.py install
## Requirements
* Django>=1.4
* django-widget-tweaks==1.3
## Configuration
### settings.py
Edit your settings.py file and add the following line into your INSTALLED_APPS
'geelweb.django.twitter_bootstrap_form'
### HTML templates
Load the filters and use them
{% load twitter_bootstrap %}
Default form
<form role="form">
{{ default_form|twitter_bootstrap }}
<button type="submit" class="btn btn-default">Submit</button>
</form>
Search form / Navbar form
<form role="search" class="navbar-form">
{{ search_form|twitter_bootstrap:"search" }}
<button type="submit" class="btn btn-default">Search</button>
</form>
Inline form
<form role="form" class="form-inline">
{{ inline_form|twitter_bootstrap:"inline" }}
<button type="submit" class="btn btn-default">Sign in</button>
</form>
Horizontal form
<form role="form" class="form-horizontal">
{{ horizontal_form|twitter_bootstrap:"horizontal" }}
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-default">Sign in</button>
</div>
</div>
</form>
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
Close
Hashes for django-twitterbootstrap-form-0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfd2651d87981f2a091c3a5cdd3911b7117f4c668eb8d16aba01eb1436543c79 |
|
MD5 | bbd85c22625ed1e265ca3e68ce60aa5d |
|
BLAKE2b-256 | eab74981909a35aad0a6c527a764bc1bc173b8965b4e98052d765e494eaf8065 |