Welcome! In this article, I’ll be illustrating a general overview of the Flask micro web framework. I’ve developed a comprehensive web application (deployed locally) in Flask that is currently used commercially, and I’ve learned so much along the way. I know that there’s still much for me to learn – I’m discovering new things every day! If any of you learned programmers do come across something I write about that may be deprecated (or plain broken) – please let me know in the comments! This being said, however, everything I write here is from my own personal experience designing, developing, and successfully deploying a Flask application.
- OverviewFlask OverviewA little bit about Flask 🙂
- Organization Structure: AdministrativeFlask Management FilesThese are the files responsible for Flask's 'wellbeing'
- Organization Structure: VitalsApplication Content FilesThese are the files responsible for the actual content inside the app
Flask is, to get the technicalities out of the way, a micro web framework developed for Python. What that actually means is this: Flask is a package allowing you to develop web pages with Python. When I first stumbled upon Flask a long time ago (probably in late 2017) I was googling ‘how to develop web pages in Python’ or something along those lines and Flask was one of the first few search results that came up, together with Django. I flipped a coin and decided to choose Flask. Having just learnt HTML, CSS, and Python, I was stoked for a chance to combine all these languages skillsets together! On that note, the abovementioned three skillsets are all you’ll need to get a Flask application up and running.
Flask Overview
What IS Flask?
I’ll be highlighting the key components in any Flask application, so you’ll know what you’ll be working with – and what to expect when you’re done.
Flask applications, similar to other web applications, function best (and are easiest to understand) if you follow an ideal folder structure. I’ll won’t be conducting a deep-dive into the reasons behind these here (perhaps an story for another day) but you can find a link to my GitHub repository here if you’d like to fork your own copy of my arrangement (and follow along).
First, I’ll talk about the…administrative components inside the program. After that, I’ll go into the functionally vital components.
Structure: Administrative Components
and what they're used for
So far I’ve covered all the files that are necessary to get the program up and running (i.e. the administrative components of the application’s structure). Now, into the good stuff.
Structure: Vital Components
and what they're used for
That’s it! Any Flask application can adapt from this structure and it’ll run – just make sure the correct import statements are in the correct place. With this information, you’re now one step closer to making a fully functioning web application in Python!
Best article ever!! Easy to understand and clear!!
Thank you! Happy to help!