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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8e71d973ec6de5115adb9a24187083dcf3d06c236acd3c27f435e30a6057a4d |
|
MD5 | 5632ba61869c44af459fe962ad63585a |
|
BLAKE2b-256 | 5a748cff9ee1ed3c509d41d8b344314f0b8ba1c5babab895bdc01e91690d4e0a |
Close
Hashes for django_bootstrap_fields-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55ee7475e5cba68a4caa395acfbbce73a6bbbc572796d44a371c325788d08e64 |
|
MD5 | 4a3cceacb305521abd9322c96bfebff4 |
|
BLAKE2b-256 | 46a19a15e13dd9a25153f947a08e59d60816c64d81fbd5dc95e17d455fba843d |