DEV Community

loading...

Why is Flask a good web framework choice?

jones268 profile image jones268 ・2 min read

I’ve been using Python for a long time, and I continue to be impressed with how easy it is to get started with.

When developing a web app with Python, you want to use a framework. A framework makes development easier, you don't repeat the basic code over and over again. In general as a developer, you Don't want to Repeat Yourself (DRY).

You can think of a web framework as a building block.

Why use a framework?

Developing web applications is hard. Not just technically, but also in regards to managing all the moving parts. People tend to underestimate the amount of work required to get a web application off the ground.

Building a website is easy, but building something that can scale without losing its usability is where the challenge lies.

Which frameworks exist?

There are many great web frameworks out there. Python Django fans have a lot of opinions. But if you want to create a Python web app, Flask is also a great choice.

I’ve been using Flask for a long time, and I continue to be impressed with how easy it is to get started with. And once you’ve gotten up and running, the pace of development is fast.

We’ll explore some of the reasons for that in this article, but if curious take a look at the basic steps of creating a Flask-based web application.

flask python

Why Flask?

Well, in short: simplicity.

Flask is a micro-framework for Python based on Werkzeug, Jinja 2 and good intentions. It’s intended for getting started very quickly and was developed with best intentions in mind.

You could say it’s the “Pythonic Flask” ;) The default web server of Flask is the built-in development server. It’s super simple, only supports HTTP and only works for development purposes, but comes with automatic reloading of the code to see changes instantly.

  • It was designed to make getting started quick and easy, with the ability to scale up to complex applications.
  • Flask uses a built-in web server for development and a built-in development test server.
  • The development test server is used automatically when running tests, ensuring that all code runs in a proper environment.
  • Can be used with a database if needed, but not required
  • Flask is BSD licensed and supported by an active community of developers.
  • Easy to deploy online

Discussion (0)

Forem Open with the Forem app