Skip to content

API

#235: DB Migrations With Alembic and FastAPI

Our current way to create the tables in the database when we run the application works fine until we need to extend an existing table. Then SQLAlchemy will not do that for us, and we must make the change manually. With Alembic we have a solution for that problem that works great with SQLAlchemy. Let us add it to our to-do application.

#233: SQLAlchemy and FastAPI

Until now we kept our data in a variable. While that worked with an example application, the data vanishes as soon as we restart our API. To get a more realistic application, we need to persist data for a longer time. Let us explore how we can integrate SQLAlchemy with FastAPI.

#230: Fix the PydanticJsonSchemaWarning in FastAPI

While I was preparing the next post, I run into an annoying warning that I wanted to fix before I add one additional feature to the minimalistic to-do application. Let us explore what I had to do to find the reason for the warning and how I could fix the problem.

#229: OAuth2 and JWT to Protect a FastAPI Application

The HTTP basic authentication from last week has been working, but it feels a bit messy. When we search for a more current style of authentication, we end up with OAuth2 and JWT. There is an example in the FastAPI documentation that I changed a bit to use a different library for JWT, store the secret key in a .env file and use BCrypt to hash the passwords.