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
File details
Details for the file django-bootstrap-fields-0.1.1.tar.gz
.
File metadata
- Download URL: django-bootstrap-fields-0.1.1.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b1ac4d9250a3d38a81b7589233cb6d7d05c4023e431ea6e1713b3c9003ee31f |
|
MD5 | ebfdad647a85f8ea5e5806434d7e521b |
|
BLAKE2b-256 | 389cc56eee2fc863d52090e8f84ea1071f4415bc58ab57924c97a4e366209939 |
Provenance
File details
Details for the file django_bootstrap_fields-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: django_bootstrap_fields-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ea55f074e94b4019721504d5aa493909e83bd551dd5f2bf4794138a9e222215 |
|
MD5 | f10a2663db9fb9a212bff28dcbd6da98 |
|
BLAKE2b-256 | 461e610752182e7c9dffa9c1d48efb21c14555b06237001b199ae527486fa38b |