Question

I decided that I wanted to use twitter bootstrap for a potential website I want to make. However, I am still learning web development. I was wondering if someone could give me and explanation of what Crispy forms has to offer. I've been reading and I believe that it has twitter bootstrap embedded in it? I was wondering which would be a better choice to pick. This might be a bad question to ask but I'm quite confused. Are there pros and cons to picking either?

Was it helpful?

Solution

Twitter bootstrap is something completely different than crispy-forms:

Twitter bootstrap is a CSS and Javascript presentation framework. You can use it to generate your html pages from any framework, not just Django! You can use it to define how your html will be layout in a grid and also it has styles for a number of html components.

Crispy-forms is a Django application that can be used to create better layouts for forms. What it does is that you can define programatically how you want your form to be rendered (instead of doing it in the template with html). You should use it if you want to have really nice looking forms without too much hassle.

The only relation between the two is that crispy-forms actually can render your form using bootstrap layout, meaning that the styles and classes etc of your rendered html form will be following the concepts of the bootstrap framework. I am copying from here http://django-crispy-forms.readthedocs.org/en/latest/install.html#template-packs:

Since version 1.1.0 of django-crispy-forms has built-in support for different CSS frameworks, known as template packs within django-crispy-forms:

* bootstrap Bootstrap is crispy-forms’s default template pack, version 2 of the popular simple and flexible HTML, CSS, and Javascript for user interfaces from Twitter.
* bootstrap3 Twitter Bootstrap version 3.
* uni-form Uni-form is a nice looking, well structured, highly customizable, accessible and usable forms.
* foundation Foundation In creators words “The most advanced responsive front-end framework in the world”. This template pack is externally available through crispy-forms-foundation

So crispy-forms can use a bootstrap mode to render your forms -- but you have to be already using bootstrap in your django templates for this to appear properly!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top