Skip to main content

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 %}

Preview

Preview

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

django-bootstrap-fields-0.1.6.tar.gz (653.0 kB view details)

Uploaded Source

Built Distribution

django_bootstrap_fields-0.1.6-py3-none-any.whl (224.4 kB view details)

Uploaded Python 3

File details

Details for the file django-bootstrap-fields-0.1.6.tar.gz.

File metadata

  • Download URL: django-bootstrap-fields-0.1.6.tar.gz
  • Upload date:
  • Size: 653.0 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

Hashes for django-bootstrap-fields-0.1.6.tar.gz
Algorithm Hash digest
SHA256 6aeade0114e2aec49fbafac7d65ecdd53116b23452e3810daca827e828066219
MD5 0ab9839fa394ca453ec8644318b132e4
BLAKE2b-256 f4426de700c7e0f5b1ad5f5db073c30f667524e72103d8a3a1403fe8faf745a9

See more details on using hashes here.

File details

Details for the file django_bootstrap_fields-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: django_bootstrap_fields-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 224.4 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

Hashes for django_bootstrap_fields-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 66d938fe9edcbed0319910eba60573abcdc3c468df8b88e87807515195760e99
MD5 b37a0ad8c01f05f6aba130a502aaeb36
BLAKE2b-256 f1ca054a5e4f970b73dfdf82c2a587242f6f5f62ff0feda20d2a9a808a387ba8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page