Python is a versatile and open-source programming language that can be used for a range of applications. With Flask, you can create a web app by writing Python code.
Flask is a web framework that's easy to get started with and has powerful features and extensions. It's great to use for your next project because it's simple, unobtrusive, and extensible. The framework has been around for almost 8 years, and in that time it's evolved in a lot of ways.
Why Flask?
Flask is used to develop websites of all sizes and has advantages over other frameworks including:
- Lightweight and cool
- Supports extensions - Flask has support for extension packages, which makes it easy to add functionality that you'll need for your application.
- Easy templating - Flask uses Jinja2 in its default template engine.
- Full-stack - Flask includes support for unit testing and debugging, something that other frameworks usually require additional libraries to implement.
- API - Easy to build an API
- Supports cookies, sessions and other things you'd expect from a web framework
Flask is not intended to be a full-stack framework, it is intended to make development of web applications easier by providing simple modules which solve common problems.
Just like when we first started learning to drive, we don't want to deal with anything except putting the key in the ignition and pressing the gas pedal.
Using Flask feels more like riding a bicycle or typing, less like learning to use an engine crane or shift registers.
If you are new to Flask, this is a good starting course
What does building a Flask app involve?
Building a web application with Flask involves:
- Installing Flask and its dependencies
- Importing the library
- Defining a route
- Defining a view function
- Registering the view function with the router
- (optional) Creating a WSGI application to serve the application
- (optional but neat) Running the development server in debug mode
- (optional) Configuring Gunicorn to serve the application
You can also just deploy your app online in a few clicks.
Top comments (0)