jinja2, django forms and bootstrap

I am relatively new to Django and would like to adopt best practices as much a possible. Having used Flask quite a bit I’d like to use jinja2 though. Although jinja2 is easy to use with Django, to use it to render Django forms in a way it can be used with bootstrap is not.

What is the recommended way to solve this?

  • Not using Django Forms
  • Using Crispy forms (needs a lot of extra code to get it right)
  • Not using jinja2?
  • Different…?

You’ll find it easier if you use Django templates rather than Jinja2. There are only a few differences between the two, you’re unlikely to notice the performance difference, and crispy forms will work with it.

1 Like

I agree with Adam, just go with Django templates, this will make your life easier and you won’t have to jump through hoops when you use a contrib module that doesn’t have Jinja templates (99% don’t).

1 Like

Thanks guys, I’ll follow your advice :ok_hand: