How can I use Bootstrap 4 while using Flask for Python 3?

faruk13 picture faruk13 · Jan 18, 2019 · Viewed 16.3k times · Source

I have checked and found that Flask-Bootstrap natively uses Bootstrap 3.3.7 when you install it by default. But actually I wanted to use Bootstrap 4+ for my project by using Flask-Bootstrap package, any help would be much appreciated of how to update it or anything like that. Thanks

Answer

okovko picture okovko · Jan 18, 2019

There is a fork called Bootstrap-Flask that is up to date.

That said, however, it is not a good idea to use either Flask-Bootstrap or Bootstrap-Flask. These are very thin packages with a small layer of indirection that primarily serve to obscure your understanding.

Instead, I recommend using the starter template provided by Bootstrap 4, which will always be up to date to whatever version you require using their CDN.

If you stick with Bootstrap, you will soon want to build your own Bootstrap anyways so you can do things like add custom themes. Hacking Bootstrap with CSS instead of using their SASS customization scheme is painful (I did it for a while). The build process is well documented and simple enough, just a few installations required.