How and Why You Should Create a Blog with Flask
Tags:
web_dev,
blogging,
python,
flask
Date: 2025-03-02
Have you ever tried using WordPress to create a website? Limiting, not very intuitive, at times frustrating. It felt like trying to build something with your hands tied. I’m sure that for people with no programming experience, solutions like WordPress, SquareSpace, Wix, and similar platforms make sense. But for everyone else, why pay to limit your possibilities? If you can express what you want to ChatGPT, you can create a website from scratch and make it whatever you want. Plus, we've already established that no one will see it except for a few friends or some bots, so might as well learn something, right?
Why Flask?
First of all, because I don't feel like learning JavaScript. I know Python; it’s simple, versatile, and works pretty well for my interests.The choice of framework for managing the back-end of the website depends on many factors: primarily the programming language you want to use, then what kind of website you want to build. If you want to build a simple website with Python, my recommendation is Flask, because the learning curve is less steep than Django, the main alternative. Flask is a Swiss army knife, Django is the whole toolbox; choose based on what you need to build.
Please Note
This article is not a step-by-step guide for building a website. Would I complain so much about flexibility and the need for freedom, only to give you a recipe to follow? Rather, this is the story of my experience, hoping that it can help someone find a few tips here and there, or even just motivate them to create something. I don’t consider myself an expert programmer, let alone a web developer.How
Flask has two main components: one or more Python files used to define data models, manage HTTP requests, and run the application, along with one or more HTML files that make up the website’s pages. Additionally, static files are usually added to change the website’s appearance with CSS or to integrate JavaScript functions.If your website needs a database, there are two options: use SQLite, which is integrated into Python and allows you to generate a .db file, or use a real database. The second option is more serious and scalable, and even though it requires a bit more effort, it’s the one I’d recommend. I suggest Supabase: it has a free tier that’s more than enough for small projects, an intuitive interface, and also offers the ability to store files.
As for hosting, I have no doubts — Vercel comes highly recommended. Once again, the free tier is more than sufficient for this type of website. If you own a domain, it’s easy to use, and if you’re using GitHub to save your developments, deploying on Vercel is a breeze. The only thing you need to pay attention to is choosing the server location for deployment, which should be specified in the vercel.json file added to your project’s main directory. To reduce call times, the recommendation is to select the location closest to where your database is hosted.