Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
bootstrapform/ | H | 15-Mar-2018 | - | 208 | 140 | |
django_bootstrap_form.egg-info/ | H | 03-May-2022 | - | 23 | 22 | |
MANIFEST.in | H A D | 15-Mar-2018 | 49 | 3 | 2 | |
PKG-INFO | H A D | 15-Mar-2018 | 801 | 23 | 22 | |
README.rst | H A D | 15-Mar-2018 | 1.9 KiB | 71 | 47 | |
setup.cfg | H A D | 15-Mar-2018 | 67 | 8 | 5 | |
setup.py | H A D | 15-Mar-2018 | 1 KiB | 33 | 31 |
README.rst
1===================== 2Django bootstrap form 3===================== 4 5.. image:: https://badge.fury.io/py/django-bootstrap-form.png 6 :alt: PyPI version 7 :target: https://pypi.python.org/pypi/django-bootstrap-form 8 9.. image:: https://travis-ci.org/tzangms/django-bootstrap-form.png?branch=master 10 :target: https://travis-ci.org/tzangms/django-bootstrap-form 11 12.. image:: https://coveralls.io/repos/tzangms/django-bootstrap-form/badge.png?branch=master 13 :target: https://coveralls.io/r/tzangms/django-bootstrap-form?branch=master 14 15 16Twitter Bootstrap for Django Form. 17 18A simple Django template tag to work with `Bootstrap <http://getbootstrap.com/>`_ 19 20Installation 21====== 22 23Install django-bootstrap-form with pip 24 25.. code-block:: sh 26 27 $ pip install django-bootstrap-form 28 29Usage 30====== 31 32Add "bootstrapform" to your INSTALLED_APPS. 33 34At the top of your template load in our template tags:: 35 36 {% load bootstrap %} 37 38Then to render your form:: 39 40 <form role="form"> 41 <legend>Form Title</legend> 42 {% csrf_token %} 43 {{ form|bootstrap }} 44 <div class="form-group"> 45 <button type="submit" class="btn btn-primary">Submit</button> 46 </div> 47 </form> 48 49You can also set class="form-vertical" on the form element. 50 51To use class="form-inline" on the form element, also change the "|boostrap" template tag to "|bootstrap_inline". 52 53It 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:: 54 55 <form class="form-horizontal"> 56 <legend>Form Title</legend> 57 {% csrf_token %} 58 {{ form|bootstrap_horizontal }} 59 <div class="form-group"> 60 <div class="col-sm-10 col-sm-offset-2"> 61 <button type="submit" class="btn btn-primary">Submit</button> 62 </div> 63 </div> 64 </form> 65 66 67Demo 68===== 69 70Checkout this `Demo site <http://django-bootstrap-form.herokuapp.com/>`_ to see it in action. 71