render Django form fields with complete Bootstrap HTML markup
Project description
Django Bootstrap Fields
django-bootstrap-fields
provides you with a {% dbs_field %}
tag that allows you to easily render Django form fields with complete Bootstrap html markup. Works with Bootstrap 3 and 4.
Installation
Install latest stable version into your python path using pip
:
pip install -U django-bootstrap-fields
Add dbs_fields
to your INSTALLED_APPS
in settings.py
:
INSTALLED_APPS = (
...
'dbs_fields',
)
Templates
You can set your default template pack for your project using the DBS_TEMPLATES
Django settings variable:
DBS_TEMPLATES = 'bootstrap4' # Options: 'bootstrap3', 'bootstrap4', 'bootstrap4custom'
Usage
One tag to rule them all! django-bootstrap-fields
only comes with one easy to use tag that will detect which field is being rendered and style it accordingly.
{% dbs_field field inline=True sr_label=True prepend="$" append=".00" %}
Example
{% extends "base.html" %}
{% load dbs_tags %}
{% block content %}
<form action="." method="post">
{% csrf_token %}
{% for field in form %}
{% dbs_field field %}
{% endfor %}
</form>
{% endblock content %}
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
Built Distribution
Close
Hashes for django-bootstrap-fields-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b1ac4d9250a3d38a81b7589233cb6d7d05c4023e431ea6e1713b3c9003ee31f |
|
MD5 | ebfdad647a85f8ea5e5806434d7e521b |
|
BLAKE2b-256 | 389cc56eee2fc863d52090e8f84ea1071f4415bc58ab57924c97a4e366209939 |
Close
Hashes for django_bootstrap_fields-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ea55f074e94b4019721504d5aa493909e83bd551dd5f2bf4794138a9e222215 |
|
MD5 | f10a2663db9fb9a212bff28dcbd6da98 |
|
BLAKE2b-256 | 461e610752182e7c9dffa9c1d48efb21c14555b06237001b199ae527486fa38b |