Category: Flask
-

Python Pre-Commit
In this article I show how to configure pre-commit in a Python project to format and check the code. I will show 4 tools which will run automatically with the Git hooks.
-

Unit Tests with Pytest
In this article I show how to write unit tests with Pytest. I show the parametrized tests, the conftest and the fixtures.
-

Mapping and Validating with Marshmallow
In this article I explain the 3-tier architecture. From that I explain the need to have a mapping with Marshmallow. I will use Marshmallow to map my database entities to JSON objects.
-

SQLAlchemy
In this article I show how to configure SQLAlchemy in a Flask backend. I also show how to create entities which reflect some tables in a database. And show how some relationships are managed with SQLAlchemy as one-to-one, one-to-many and many-to-many.
-

Basic Authentication & JWT
In this article I show how to secure a Flask backend with Basic Authentication and also with JWT. I will show the usage of the library flask-http-auth for the Basic Authentication and the token based Authentication. Then, I will add the library pyjwt to encode and decode a JWT.
-

Dependency Management with Poetry
In this article I show the usage of Poetry and Python to manage the dependencies. I show how to create a Poetry project, how to search and add dependencies and how to manage virtual environments of Python with Poetry.
-

Flask Backend Setup
In this article I show the setup of a Flask and Python backend. I show the structure of a Flask project, how to add routes to Flask, how to group routes with Blueprints and how to handle errors.
