https://github.com/mtokoly/django-bootstrap-fields
The app provides you with a tag that allows you to easily render Django form fields with complete Bootstrap HTML markup.
https://github.com/mtokoly/django-bootstrap-fields
bootstrap3 bootstrap4 django django2 python
Last synced: 7 months ago
JSON representation
The app provides you with a tag that allows you to easily render Django form fields with complete Bootstrap HTML markup.
- Host: GitHub
- URL: https://github.com/mtokoly/django-bootstrap-fields
- Owner: mtokoly
- License: mit
- Created: 2019-06-25T17:58:48.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-30T16:36:33.000Z (almost 7 years ago)
- Last Synced: 2025-09-27T17:21:03.648Z (10 months ago)
- Topics: bootstrap3, bootstrap4, django, django2, python
- Language: Python
- Homepage:
- Size: 414 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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 %}
{% csrf_token %}
{% for field in form %}
{% dbs_field field %}
{% endfor %}
{% endblock content %}
~~~~
## Preview
