django-bootstrap-forms

Twitter Bootstrap ready Django forms
Download

django-bootstrap-forms Ranking & Summary

Advertisement

  • Rating:
  • License:
  • The Apache License 2.0
  • Price:
  • FREE
  • Publisher Name:
  • Earle Ady
  • Publisher web site:
  • http://github.com/earle/

django-bootstrap-forms Tags


django-bootstrap-forms Description

django-bootstrap-forms is a Django app that provides Twitter bootstrap ready Django forms.Installation1. Install using pip: pip install -e git+git://github.com/earle/django-bootstrap.git#egg=bootstrap2. Add to INSTALLED_APPS: 'bootstrap',Usage from bootstrap.forms import BootstrapForm, Fieldset class LoginForm(BootstrapForm): class Meta: layout = ( Fieldset("Please Login", "username", "password", ), ) username = forms.CharField(max_length=100) password = forms.CharField(widget=forms.PasswordInput(), max_length=100)If you want to use the Bootstrap Form wrapper on a built-in form, such as those in `django.contrib.auth.forms` then you can use the mixin class. from django.contrib.auth.forms import PasswordChangeForm from bootstrap.forms import BootstrapMixin, Fieldset class BootstrapPasswordChangeForm(BootstrapMixin, PasswordChangeForm): class Meta: layout = ( Fieldset("Change your password", "old_password", "new_password1", "new_password2"),When using the mixin directly it must be the first class your form inherits from.Template Usage < form action="/login/" method="post" class="form-horizontal" > {{ form }} < div class="form-actions" > < button type="submit" class="btn btn-primary" >Login< /button > < /div > < /form >Product's homepage


django-bootstrap-forms Related Software