Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tzangms/django-bootstrap-form
Twitter Bootstrap for Django Form
https://github.com/tzangms/django-bootstrap-form
Last synced: 3 months ago
JSON representation
Twitter Bootstrap for Django Form
- Host: GitHub
- URL: https://github.com/tzangms/django-bootstrap-form
- Owner: tzangms
- License: bsd-3-clause
- Created: 2011-08-21T16:04:18.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2024-03-07T06:44:27.000Z (11 months ago)
- Last Synced: 2024-05-22T15:09:41.190Z (8 months ago)
- Language: HTML
- Homepage:
- Size: 208 KB
- Stars: 558
- Watchers: 27
- Forks: 183
- Open Issues: 40
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.txt
- License: LICENSE
Awesome Lists containing this project
- awesome-tw-foss - Django Bootstrap Form - Twitter Bootstrap for Django Form. (Lib/Framework/API/Dev Tool)
README
=====================
Django bootstrap form
=====================.. image:: https://badge.fury.io/py/django-bootstrap-form.png
:alt: PyPI version
:target: https://pypi.python.org/pypi/django-bootstrap-form.. image:: https://travis-ci.org/tzangms/django-bootstrap-form.png?branch=master
:target: https://travis-ci.org/tzangms/django-bootstrap-form.. image:: https://coveralls.io/repos/tzangms/django-bootstrap-form/badge.png?branch=master
:target: https://coveralls.io/r/tzangms/django-bootstrap-form?branch=master
Twitter Bootstrap for Django Form.
A simple Django template tag to work with `Bootstrap `_
Installation
======Install django-bootstrap-form with pip
.. code-block:: sh
$ pip install django-bootstrap-form
Usage
======Add "bootstrapform" to your INSTALLED_APPS.
At the top of your template load in our template tags::
{% load bootstrap %}
Then to render your form::
Form Title
{% csrf_token %}
{{ form|bootstrap }}
Submit
You can also set class="form-vertical" on the form element.
To use class="form-inline" on the form element, also change the "|boostrap" template tag to "|bootstrap_inline".
It is also possible to create a horizontal form. The form class and template tag are both changed, and you will also need slightly different CSS around the submit button::
Form Title
{% csrf_token %}
{{ form|bootstrap_horizontal }}
Submit
Demo
=====Checkout this `Demo site `_ to see it in action.