Skip to content

voxy/django-bootstrap-select

Repository files navigation

Django Bootstrap Select

https://travis-ci.org/voxy/django-bootstrap-select.svg?branch=master

A Django wrapper for the Bootstrap Select library

Documentation

The full documentation is at https://django-bootstrap-select.readthedocs.io.

Quickstart

Need to render an image in a select box?

Turn this:

docs/img/select_box.png

Into this:

docs/img/bootstrap_select_box.png

Install Django Bootstrap Select:

pip install django-bootstrap-select

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'bootstrap_select.apps.BootstrapSelectConfig',
    ...
)

Using it in a form:

def get_choices():
    choices = (('face.jpg', escape('<img src="path-to-face.jpg"/>'),)
    return choices

class IconForm(forms.Form):
    icon = forms.URLField(widget=BootstrapSelect(choices=get_choices()))

Features

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

Credits

Tools used in rendering this package: