Dynamic websites with Flask

yiftachbeer

Yiftach Beer

Posted on February 4, 2024

Dynamic websites with Flask

I use Python for both work and hobby projects. Some of the projects I create require external access for which I use Flask, for example:

  • a minimalistic UI that allows someone to go over some items and give feedback over them (I use Flask to display each in its own page)
  • allowing me to call some function on my computer (e.g. play a sound) from my phone (I wrap my function in a Flask route)
  • etc.

Flask seems great for when each of these pages is static. However, if some need arises and I need to make them dynamic (e.g. checking some checkbox makes some component visible), I'm not sure what today's best practice is. Flask does give me the option to use javascript as part of the templates it displays, but using plain javascript seems outdated - the proper way to build reactive pages is using React/Angular etc. But when these are combined with Flask, tutorials I've seen suddenly assume you only use Flask as an API (just returning JSON data) and not as a proper server, which seems like a small addition requiring a large overhaul.

Which setups work for you for making Flask pages display dynamic pages?

💖 💪 🙅 🚩
yiftachbeer
Yiftach Beer

Posted on February 4, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Dynamic websites with Flask
discuss Dynamic websites with Flask

February 4, 2024