django bootstrap form’s documentation

本文介绍了如何利用Django Bootstrap Form库将Django表单转换为Twitter Bootstrap样式,包括安装、配置和使用示例。文章还详细说明了库的更新历史,涵盖支持Bootstrap 3和新增的Radio按钮支持。

django bootstrap form’s documentation

Django bootstrap form
Generate twitter-bootstrap form output for django form
A simple Django template tag to work with twitter bootstrap ( http://twitter.github.com/bootstrap/ )

Screenshot

Installation

Install django-bootstrap-form with pip


 
  1. $ pip install django-bootstrap-form

Configuration

Add ‘bootstrapform’ to INSTALLED_APPS.


 
  1. INSTALLED_APPS = (
  2. ...
  3. 'bootstrapform',
  4. ...
  5. )

Usage


 
  1. {% load bootstrap %}
  2. {{ form|bootstrap }}
  3. # or use with individual field
  4. {{ form.<field name>|bootstrap }} - To output individual fields
  5. # For horizontal forms
  6. {{ form|bootstrap_horizontal }}
  7. # Or with custom size (default is 'col-lg-2 col-sm-2')
  8. {{ form|bootstrap_horizontal:'col-lg-4' }}

CHANGELOG

2013-8-27:
Add support for Bootstrap 3, contributed by Nivl
2013-5-7:
Add radio support for ChoiceField





转载于:https://www.cnblogs.com/Leman/p/5337352.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值