OAuth Authentication with Flask in 2023

Posted by
on under

A long time ago I wrote a tutorial on how to add logins with a social network to your Flask application, using the OAuth protocol. It's been almost 9 years since I wrote that article, and believe it or not, the OAuth protocol continues to be well supported by all major players including Twitter, Facebook, Google, GitHub and many more.

But of course, 9 years is a very long time in tech. Even though not much has changed in terms of how this method of authentication works, some of the packages that I've used back then have had major upgrades, while others have become unmaintained, so an update is due.


Flask + OAuth 2.0 Demo

Create a MySQL Database using Docker

Posted by
on under

MySQL is an open-source relational database owned by Oracle Corporation. The instructions I'm going to share in this article demonstrate how to install and set up a MySQL server along with the popular phpMyAdmin management application. As a bonus, I will also show you how to set up Python to access your MySQL database.

This article is an excerpt from my book SQLAlchemy 2 In Practice, where I show how to work with relational databases using Python and the SQLAlchemy library.

What's New in SQLAlchemy 2.0?

Posted by
on under

You may have heard that a major version of SQLAlchemy, version 2.0, has been released in January 2023. Or maybe you missed the announcement and this is news to you. Either way, I thought you'd be curious to know what's new in it, if it is worth upgrading and how difficult the upgrade is.

As with previous software reviews, this is going to be an opinionated overview. I have been using the SQLAlchemy ORM in web projects for a long time, so in this article I will discuss the features that affect my own work, both in positive or negative ways. If instead you are interested to see a list of every change that went into this new release, then the official change log is the place to go.

The React Mega-Tutorial, Chapter 12: Production Builds

Posted by
on under

You have an application that you have been using in your own computer during development. How do you put this application in front of your users? In this chapter you are going to learn how to work with production builds of your application.

The React Mega-Tutorial, Chapter 11: Automated Testing

Posted by
on under

Up to now, all the testing done on the application you've built was manual. Manual testing as you develop your application is useful, but as the application grows the required testing effort grows as well, until it becomes so time-consuming that the only way to keep up is to test less, or to find a way to automate some testing work. In this chapter you are going to learn some techniques to create automated tests for your React application.

The React Mega-Tutorial, Chapter 10: Memoization

Posted by
on under

An important part of React that you haven't seen yet is memoization, a technique that helps prevent unnecessary renders and improve the overall performance of the application. In this chapter you are going to learn how the React rendering algorithm works, and how you can make it work efficiently for your application.

The React Mega-Tutorial, Chapter 9: Application Features

Posted by
on under

By now you have learned most of the React concepts you need to complete this application. This chapter is dedicated to building the remaining features of the application, with the goal of solidifying the knowledge you acquired in previous chapters.

The React Mega-Tutorial, Chapter 8: Authentication

Posted by
on under

Up to this point, you have been using the Microblog API back end with an option to bypass authentication. This enabled the project to grow without having to deal with the highly complex matter of user authentication up front. In this chapter you will finally learn how to do this.

The React Mega-Tutorial, Chapter 7: Forms and Validation

Posted by
on under

A big part of most web applications is accepting, validating and processing user input. In this chapter you are going to learn how to perform these tasks with React by creating the user registration and login forms for Microblog.

The React Mega-Tutorial, Chapter 6: Building an API Client

Posted by
on under

In Chapter 5, the Posts component was modified to make an API call that gets data from the server. The way it was done, however, does not scale very well, because as the application continues to grow, there's going to be other components that will also need to make their API calls, and having to repeat the API calling logic in several places will be difficult to manage, especially considering that these calls are going to become more complex once authentication and pagination are implemented.