• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

bootstrapform/H15-Mar-2018-208140

django_bootstrap_form.egg-info/H03-May-2022-2322

MANIFEST.inH A D15-Mar-201849 32

PKG-INFOH A D15-Mar-2018801 2322

README.rstH A D15-Mar-20181.9 KiB7147

setup.cfgH A D15-Mar-201867 85

setup.pyH A D15-Mar-20181 KiB3331

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