Giter VIP home page Giter VIP logo

django-forms-bootstrap's Introduction

Django Forms Bootstrap

Simple Twitter Bootstrap filter for Django forms. Extracted from the bootstrap theme for Pinax.

Quick Start

Include "django-forms-bootstrap" in your requirements file and "django_forms_bootstrap" in your INSTALLED APPS.

Make sure your template loader finders includes app directories.

To style forms, add the following to the top of your template

{% load bootstrap_tags %}

and include your form using something like the following markup:

<form>
    <legend>My Form</legend>
    {% csrf_token %}
    {{ form|as_bootstrap }}
    <div class="form-actions">
      <a href="#back" class="btn">Go back</a>
      <button type="submit" class="btn btn-primary">Save changes</button>
    </div>
</form>

Specifying form layouts

Bootstrap includes styles for four types of forms. To change the display of your form, add one of the following class attributes to your form tag:

Name Class Description
Vertical (default) .form-vertical Stacked, left-aligned labels over controls
Horizontal .form-horizontal Float left, right-aligned labels on same line as controls
Inline .form-inline Left-aligned label and inline-block controls for compact style
Search .form-search Extra-rounded text input for a typical search aesthetic

License & Attribution

Django Forms Bootstrap is released under the MIT license. It does not include any styles or scripts from the Twitter Bootstrap project.

django-forms-bootstrap's People

Contributors

paltman avatar lukeman avatar brosner avatar sefakilic avatar

Watchers

Juan Bonfante avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.