The Flask Mega-Tutorial, Part VII: Error Handling

Posted by
on under

This is the seventh installment of the Flask Mega-Tutorial series, in which I'm going to tell you how to do error handling in a Flask application.

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.

Some More To Talk About Flask

Posted by
on under

A few days ago I published a harsh critique of the Flask's team practices with regards to releases, versioning and especially about their weak backwards compatibility track record. This generated a bit of a stir and lots of people, including members of the Flask core development itself, have voiced their opinions.

I'm going to start by admitting that even though I have received some support, there has been a lot of push back as well. I really have no problem with this, as I don't hide from criticism. In this follow up article I'm going to talk about the good and the bad takes that resulted from my blog post, but I especially want to dissect the opposing views.

We Have To Talk About Flask

Posted by
on under

Flask 3.0 was released on September 30th, 2023, along with a parallel 3.0 release of Werkzeug, its main dependency. That day, the Flask-Login extension, one of the most popular of all Flask extensions, stopped working due to a backwards incompatible change introduced in Werkzeug. It is October 19th when I'm writing this, and Flask-Login remains broken. As a result, any person using my Flask Mega-Tutorial will hit issues, because my tutorial uses Flask-Login. Not only that, every Flask tutorial that features Flask-Login, from every author, in every language, in written or video form, is going to fail for as long as this problem remains. Hard to believe, right? (Update: a fixed release of Flask-Login was published on October 30th)

If this was the first occurrence of something of this nature in the Flask community, I would hope it would serve as a lesson for the Flask maintainers to learn from and avoid in the future. Sadly, this happens pretty much every time there is a major release of Flask, and sometimes minor ones too. Why does this happen? How can it be avoided? In this article I'll try to make an assessment of the current situation and how it can be prevented going forward.

There is now an update to this post as well.