Flask Mega-Tutorial

 · shakiestnerd

If you are trying to learn Flask, then you have probably encountered the "Flask Mega-Tutorial" by Miguel Grinberg. If not, do yourself a favor and go check it out immediately.

It will take some time to work through it. Don't just try to read it, you must work through it. The lessons you will learn in doing a deep dive into the code exceed what the code does.

Here is a sample screen shot of the tutorial site after Chapter IX:

Mega Tutorial Chapter 9

Some of the take-aways from this project are:

  • A solid method for organizing your projects in folders.
  • With Part XV, the tutorial moves into Blueprints which is a way to organize larger applications, or even multiple applications.
  • Structuring your code into routes, forms and models that mimic the MVC (model-view-controller) design pattern.
  • Learning tools that are common for Flask projects.
  • WTForms
  • SQLAlchemy
  • Jinja2
  • alembic
  • Flask-Login
  • ... just to name a few.
  • It's also good that the tutorial postpones adding Bootstrap until Chapter XI. This allows you to focus on the content without any formatting getting in the way.
  • Working through the tutorial gives you the chance to practice debugging. Because, you will miss things that will have to be corrected.
  • If you are not familiar with HTML, CSS and some javascript, learn those first. Flask can be a daunting when you first encounter it. So, build up your understanding of basic web tools before tackling.
  • Read some of the comments. You will find issues that other learners have had to overcome while going through this.

MegaTutorial Chapter XI

After chapter 11, which employs Flask-Bootstrap, the look and feel of the application picks up. This was the first time I've seen the Flask Bootstrap module that encapsulates a lot of bootstrap and really simplifies things. Sort of amazing.

I have peeked at upcoming chapters and I can't wait for the full text search chapter that implements Elasticsearch.