Latest posts
- SQLAlchemy 2 In Practice - Chapter 7: Asynchronous SQLAlchemyMay 06, 2026Miguel Grinberg
This is the seventh chapter of my SQLAlchemy 2 in Practice book. If you'd like to support my work, I encourage you to buy this book, either directly from my store or on Amazon. Thank you! Starting with release 1.4, SQLAlchemy includes support for asynchronous programming with the asyncio package, for both the Core and ORM modules. This is an exciting improvement that brings the power of SQLAlchemy
- How Bitwarden Encrypts and Decrypts SecretsApr 26, 2026Miguel Grinberg
As part of my efforts in reducing my dependency on Big Tech, I have been researching how to self-host my password manager. One solution that looks very promising is Vaultwarden, an open source clone of the Bitwarden cloud server. An interesting aspect of this server is that it stores all the secrets in a standard SQLite database, so in addition to having the self-hosted password server I could kee
- SQLAlchemy 2 In Practice - Chapter 6: A Page Analytics SolutionApr 23, 2026Miguel Grinberg
This is the sixth chapter of my SQLAlchemy 2 in Practice book. If you'd like to support my work, I encourage you to buy this book, either directly from my store or on Amazon. Thank you! The goal of this chapter is to use the concepts you have learned to build a web traffic analytics solution. This will serve as reinforcement of the techniques demonstrated in previous chapters as well as an example
- SQLAlchemy 2 In Practice - Chapter 5 - Advanced Many-To-Many RelationshipsApr 16, 2026Miguel Grinberg
This is the fifth chapter of my SQLAlchemy 2 in Practice book. If you'd like to support my work, I encourage you to buy this book, either directly from my store or on Amazon. Thank you! You have now learned the design blocks used in relational databases. Sometimes, however, these building blocks have to be "tweaked" a bit to achieve a desired goal. This chapter is dedicated to exploring a very use
- SQLAlchemy 2 In Practice - Chapter 4 - Many-To-Many RelationshipsApr 09, 2026Miguel Grinberg
This is the fourth chapter of my SQLAlchemy 2 in Practice book. If you'd like to support my work, I encourage you to buy this book, either directly from my store or on Amazon. Thank you! Continuing with the topic of relationships, this chapter is dedicated to the many-to-many type, which as its name implies, is used when it is not possible to identify any of the sides as a "one" side.
- SQLAlchemy 2 In Practice - Chapter 3 - One-To-Many RelationshipsApr 02, 2026Miguel Grinberg
This is the third chapter of my SQLAlchemy 2 in Practice book. If you'd like to support my work, I encourage you to buy this book, either directly from my store or on Amazon. Thank you! In the previous chapter you learned how to execute a variety of queries on the products table. Interestingly, some of those queries were designed to obtain product manufacturers and not products, and this required
- SQLAlchemy 2 In Practice - Chapter 2 - Database TablesMar 26, 2026Miguel Grinberg
This is the second chapter of my SQLAlchemy 2 in Practice book. If you'd like to support my work, I encourage you to buy this book, either directly from my store or on Amazon. Thank you! This chapter provides an overview of the most basic usage of the SQLAlchemy library to create, update and query database tables.
- SQLAlchemy 2 In Practice - Chapter 1 - Database SetupMar 19, 2026Miguel Grinberg
Welcome! This is the start of a journey which I hope will provide you with many new tricks to improve how you work with relational databases in your Python applications. Given that this is a hands-on book, this first chapter is dedicated to help you set up your system with a database, so that you can run all the examples and exercises. This is the first chapter of my SQLAlchemy 2 in Practice book.
- Introduction to SQLAlchemy 2 In PracticeMar 12, 2026Miguel Grinberg
In 2023 I wrote "SQLAlchemy 2 In Practice", a book in which I offer an in-depth look at SQLAlchemy version 2, still the current version today. SQLAlchemy is, for those who don't know, the most popular database library and Object-Request Mapper (ORM) for Python. I have a tradition of publishing my books on this blog to read for free, but this is one that I never managed to bring here, and starting
- How to Host your Own Email ServerMar 06, 2026Miguel Grinberg
I recently started a new platform where I sell my books and courses, and in this website I needed to send account related emails to my users for things such as email address verification and password reset requests. The reasonable option that is often suggested is to use a paid email service such as Mailgun or SendGrid. Sending emails on your own is, according to the Internet, too difficult. Becau