
Earle/django-bootstrap - GitHub - superchink
https://github.com/earle/django-bootstrap
======
andr
Great to have this, but I very much dislike the idea of changing the base Form
classes just to get a different rendering.

What I've been doing in Django is using Jinja template macros to create my own
rendering for the standard form classes. Not ideal, but sticks to the idea of
separation of logic and presentation.

~~~
earle
The template tags and filters will certainly solve most use cases, but there
are specific reasons why Django implements Forms outside of the template --
there will be significant functionality you cant (and shouldnt) achieve
through a template.

This is why the base Form was extended. To each their own.

------
lukeman
We're doing something far more comprehensive with the Bootstrap theme for
Pinax and if not for a few things you don't even really need Pinax and can
just use Django with our theme app: <http://github.com/pinax/pinax-theme-
bootstrap/>

~~~
randlet
I've been using this with great results on an intranet project. It's allowed
me to have a professional looking site without having to put much thought into
design & layout. Thanks so much!

------
po
Ha, I was just looking into something like this.

Interestingly one approach is to use the django uni-form project with the {%
form|as_uni_form %} filter. You can then output whatever HTML you want. The
<https://github.com/kennethlove/django-uni-form-contrib> project provides a
good starting point for templates compatible with the bootstrap project but
looking at it, there's still a lot to be desired and it looks somewhat
inactive.

~~~
huxley
One factor might be that django uni-form is being replaced with django-crispy-
forms[1], some functionality of django uni-form contrib is begin rolled into
django crispy forms.[2]

[1] <https://github.com/maraujop/django-crispy-forms/>

[2] <https://github.com/maraujop/django-crispy-forms/issues/5>

------
nulluk
We have been including a similar thing in our project base for some time and
have been through quite a few iterations & ways to implement something like
this. Thus far we are using something very similar:
<https://github.com/theorm/django-bootstrap-forms>

------
aiurtourist
This is a great project that helps to bring a more "hip" feel to Django
development.

FWIW, if you're working with a lot of CSS and JavaScript resources, check out
webassets (<https://github.com/miracle2k/webassets>) for building asset
bundles.

------
StavrosK
My alternative to this was to write an inclusion template tag. This separates
logic from presentation more cleanly, and it allows forms where, for example,
first name and last name fields take up half of the space of the same row, and
the rest of the fields are on full rows.

~~~
earle
See above

------
joelhaasnoot
I use django-uni-form all the time in my projects but use the helper syntax.
By having a form helper you can completely customize every aspect of your
form.

