The Flask Mega-Tutorial, Part VI: Profile Page and Avatars

Posted by
on under

This is the sixth installment of the Flask Mega-Tutorial series, in which I'm going to tell you how to create the user profile page.

The Flask Mega-Tutorial, Part V: User Logins

Posted by
on under

This is the fifth installment of the Flask Mega-Tutorial series, in which I'm going to tell you how to create a user login subsystem.

The Flask Mega-Tutorial, Part IV: Database

Posted by
on under

This is the fourth installment of the Flask Mega-Tutorial series, in which I'm going to tell you how to work with databases.

The Flask Mega-Tutorial, Part III: Web Forms

Posted by
on under

This is the third installment of the Flask Mega-Tutorial series, in which I'm going to tell you how to work with web forms.

The Flask Mega-Tutorial, Part II: Templates

Posted by
on under

In this second installment of the Flask Mega-Tutorial series, I'm going to discuss how to work with templates.

The Flask Mega-Tutorial, Part I: Hello, World!

Posted by
on under

Welcome! You are about to start on a journey to learn how to create web applications with Python and the Flask framework. In this first chapter, you are going to learn how to set up a Flask project. By the end of this chapter you are going to have a simple Flask web application running on your computer!

It's Time For A Change: datetime.utcnow() Is Now Deprecated

Posted by
on under

I was going through the release notes of the new Python 3.12 version the other day, and one item caught my attention in the deprecations section:

datetime.datetime’s utcnow() and utcfromtimestamp() are deprecated and will be removed in a future version.

If you have followed my web development tutorials you must have seen me use utcnow() a lot, so I will clearly need to re-train myself to use an alternative, in preparation for the eventual removal of this function (likely a few years out, so no need to panic!).

In this short article I'll tell you more about why these functions are getting the axe, and what to replace them with.

Building a Toy Programming Language in Python, Part 2

Posted by
on under

Welcome to the second part of my tutorial on creating a toy language I called my in Python. In the first part I showed how how to implement the lexer, parser and interpreter for a very simple version of the language that did only one thing: print numbers.

With the first phase of the project completed, and with a solid base to start building from, I'll show you how to extend the language in a few ways. The purpose of this is to demonstrate how to modify this language, so that you can then build your own extensions. If you need a reference for the code, this GitHub repository has the working code that you can try.

Building a Toy Programming Language in Python

Posted by
on under

I thought it would be fun to go outside of my comfort zone of web development topics and write about something completely different and new, something I have never written about before. So today, I'm going to show you how to implement a programming language!

The project will parse and execute programs written in a simple language I called my (I know it's a lame name, but hey, it is "my" language). The implementation is going to be in Python, without any external dependencies. The my language is simple enough to make this project reasonably short, but also complex enough to make it interesting. If you are only interested in the complete code, you can find it in this GitHub repository. If you want to learn, then read on!

In this first installment of this series, I'll show you how to build a very basic programming language that implements a print statement. Then in the second part I'll extend the language to support variables and mathematical expressions. The end goal is a programming language implementation that can execute programs such as this one:

a = 3
b = 4 + a * 2
print b + 1

Once you learn the techniques involved in bringing my to life, you will be able to extend the language in any way you like and make it yours too. Sounds interesting? Let's get started!

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