Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django: Why should I use a package for Twitter bootstrap integration?

I read several posts about which bootstrap package use (mainly Crispy-form VS django-toolkit-integration)

But I'm pretty new to Django and I still don't understand what is the real need about these packages. I mean, Twitter bootstrap is nothing more than css/js files. So, I thought using bootstrap by linking my Django forms and field to HTML classes (using widgets for .py forms, and directly in .html templates for other fields)

So, what are the benefits of these packages? Is it just convenience or am I really missing something if I choose to not use it?

Thank you for help!

like image 803
David D. Avatar asked Apr 08 '13 11:04

David D.


2 Answers

It is just a convenience for forms. It provides you with template tags. Django provides two methods as_p, as_ul and as_table but none of them works smoothly with bootstrap. So you use something like instead.

{% extends 'base.html' %}
{% load crispy_forms_tags %}

{% block content %}
    {% form|crispy %}
{% endblock %}

It also provides some convenient classes to configure in the Django Forms.

So, it is not necessary but it will save you some hassles to configure forms. You can start without them and when the problems come, you will find them useful.

like image 64
toto_tico Avatar answered Sep 30 '22 15:09

toto_tico


As you yourself said, Twitter Bootstrap are only CSS and JS files that you will apply in your HTML structure and get a new face of its elements. The Bootstrap provides a number of ready-made elements and styles.

Many websites come ready structures and even site templates ready using Bootstrap, as: Bootsnipp, Bootswatch, Wrapbootstrap and many others. The big advantage I see is not wasting time with styles (I'm not disparaging the designers) and focus more on programming.

My final note is: give a chance to the Twitter Bootstrap, it is very useful in creating models and styles faster, more focused on the end product.

like image 30
Filipe Manuel Avatar answered Sep 30 '22 17:09

Filipe Manuel