Bootstrap3 for Django
Bootstrap is a free and open-source front-end web framework for designing websites and web applications. It contains HTML- and CSS-based design templates for typography, forms, buttons, navigation and other interface components, as well as optional JavaScript extensions. Unlike many web frameworks, it concerns itself with front-end development only.
On github, there is a package that design for django developers to use bootstrap3 conveniently, its name is django-bootstrap3.
This package requires python 2.7 or above and django 1.8 or above, you can get its beta version by clone its github repo: django-bootstrap3, or get stable version by pip:
Use django-bootstrap3 in your Django Project
The first thing you should do is to tell your project the package’s name and existence: adding
bootstrap3
toINSTALLED_APPS
in yoursettings.py
.In your templates, use django rule to ‘import’ this library:
1{% load bootstrap3 %}After that you can use bootstrap3 tags formatted as
bootstrap_*
, there is a small example from its github README.rst:12345678910111213{% load bootstrap3 %}{# Display a form #}<form action="/url/to/submit/" method="post" class="form">{% csrf_token %}{% bootstrap_form form %}{% buttons %}<button type="submit" class="btn btn-primary">{% bootstrap_icon "star" %} Submit</button>{% endbuttons %}</form>
For about more information about bootstrap3’s tags, forms and other features, you can visit its documentation