2021-07-14T12:01:19Z

Flask Mega-Tutorial Update: Flask 2.0 and more!

I'm excited to share that I've completed a revision of the Flask Mega-Tutorial to keep it in line with new releases of Flask, Python and third-party dependencies.

Flask Mega-Tutorial

To celebrate this update, you can purchase the paid version of this course with a $10 USD discount (this offer is valid through the rest of July 2021). If you are interested in this offer, use the FLASK2 promotional code at checkout, or click here to go directly to the order page with the coupon added. Thank you!

What's in this Update?

While I've made changes in every chapter, below is a list of some of the most interesting updates:

  • Tested to work well with the new Flask 2 release (as well as remaining compatible with Flask 1.x releases)
  • Tested to work well with the 3.6, 3.7, 3.8 and 3.9 releases of Python.
  • All dependencies upgraded to their latest official versions.
  • The updated code has been pushed to the GitHub repository.
  • The FLASK_DEBUG environment variable was replaced with the more modern FLASK_ENV.
  • The importance of the .flaskenv file is more clearly stated.
  • Recommend SendGrid as an alternative email service with a decent free email sending quota.
  • Fixed backwards incompatible changes in the pyjwt package.
  • Switched to the langdetect package for language detection.
  • Upgraded Ubuntu to 20.04 in Linux deployment chapter.
  • Addressed issues with Heroku's Postgres database and SQLAlchemy 1.4.
  • Solved issues with recent releases of the pymysql package requiring the cryptography package to be installed as well.

There is one aspect of the tutorial that is still in need of an update: the use of the Flask-Bootstrap extension. Unfortunately this extension has not been updated in a long time, and it continues to require version 3 of the Bootstrap CSS framework, which is now two major releases old. While there are a few forks of Flask-Bootstrap that implemented support for Bootstrap 4, there are currently none that I know of that support Bootstrap 5. Out of the Bootstrap 4 forks, most are already unmaintained, or else they don't have a clear path to Bootstrap 5. Given that there are no worthy successors to Flask-Bootstrap, I have decided to continue using this old version, which continues to work well, with the caveat that it keeps the user interface stuck on Bootstrap 3. I will continue to monitor this and update the Bootstrap chapter when a good alternative to Flask-Bootstrap appears.

How to Get this Update

The update to the tutorial is available right now on this blog. This continues to be freely available to everyone.

If you have purchased the paid version from my Courses page, first of all thank you so much for your support, and second, you can find the updated ebook downloads and text of the tutorial in your course page. Note that most of the updates are minor in nature, so at this time I have not made updates to the video material.

7 comments

  • #1 Ken Hommel said 2021-07-16T05:09:01Z

    Thank you for the tutorial, it's amazing!

    What do you think of using structured logging? I'm looking into building RESTful web services, and I think structured logging is essential. "structlog" seems like a good solution, but integrating it with Flask seems extremely difficult. Have you ever dealt with this issue?

    Thanks again, Ken Hommel

  • #2 Varoon said 2021-07-16T09:10:46Z

    Thank you for updating the course, I still use the material. I hoped that Flask-Bootstrap would have been updated. Never the less good stuff.

  • #3 Miguel Grinberg said 2021-07-16T11:07:04Z

    @ Ken: I haven't done work with structlog recently, but have used it in the past. What is the difficult aspect to integrate with Flask? Can't you just use structlog on its own? I don't recall having to do any integration, I just imported it and used it. Flask does not interfere with it.

  • #4 Alex Zh said 2021-07-20T13:24:56Z

    Hi Miguel, thank you for all the work that you've done for Flask learners like myself!

    I'm curious, what is the difference between the free tutorial available on the blog vs the paid course on your website vs the Udemy course?

  • #5 Miguel Grinberg said 2021-07-20T15:48:20Z

    @Alex: the version of the tutorial in my courses page includes the written tutorial, a video walkthrough of all of it (11+ hours of video) and ebook version of the written material. The version on Udemy has just the video material. The version of the tutorial on this blog has just the written content.

  • #6 G said 2021-07-23T17:39:15Z

    Awesome stuff! Thanks for updating it. This is still the gold standard for flask development. Are you considering adding the testing on the v2 as well?

  • #7 Miguel Grinberg said 2021-07-23T22:10:08Z

    @G: I haven't removed anything related to testing for this revision.

Leave a Comment