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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5d69e5a434e27b30171b143ec65ff761aa6ba51ca4ce0f71029f73525d05790 |
|
MD5 | 55faba50fe3cc9c8cf5c3846477e2cef |
|
BLAKE2b-256 | f898ba5bd6d7191ed1f8921e3787aa1948af6b8f08248e73effd3d37bb8f51db |
Close
Hashes for django_bootstrap_fields-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e87b6cbcf30e56350eaed81576a10e0dfdd4020d23461957646f7482e90b50ad |
|
MD5 | bd553a923893202090b6e462a111db0f |
|
BLAKE2b-256 | 8ec2cfda62e6e85ccc2f5fe2d83125d78eff506e5c3eee755779e6dc1f125ba8 |