The tutorial line up for PyCon 2016 in Portland, Oregon has been announced, and I'm excited to be part of it with yet another Flask tutorial. For some odd reason, not all the class information I provided with my proposal was published on the PyCon website, so I want to give you a good overview of the material I plan to cover here, to help you decide if this tutorial is for you.
My Flask tutorial is scheduled for Saturday, May 28th from 9am to 12:20pm. PyCon tutorials have a registration fee of $150 each if purchased ahead of time, or $200 if purchased the same day at the door. Note that tutorial fees are separate and not included in the conference registration. Your tutorial registration also gives you access to lunch on the tutorial day.
If you want to have an idea of what you get from one of my Flask tutorials, here are the two that I gave in past years:
Flask Workshop: A beginner's Flask tutorial I gave at PyCon 2015
Flask By Example: An intermediate Flask tutorial I gave at PyCon 2014
This class that I'm preparing for this year's PyCon is for intermediate and advanced Flask developers looking to learn the patterns and best practices that can help scale a Flask application, both in terms of application size and load. In terms of complexity, this class would go after the two above and will be the most advanced Flask class I have ever given. The topics are divided into two main areas:
- Large applications: How to organize code, templates and static files in a way that allows the application to grow without becoming a mess.
- Flask under load: Different ways to deploy a Flask application so that it can handle large numbers of clients.
Below you can see the description and abstract as published on the PyCon website, plus the tentative class outline, which was not published:
Do you think that because Flask is a micro-framework, it must only be good for small, toy-like web applications? Well, not at all! In this tutorial I am going to show you a few patterns and best practices that can take your Flask application to the next level.
Can Flask scale? For many, that is the million dollar question. Unfortunately even the Flask official documentation is ambiguous about this topic. Flask is a small, unobtrusive framework that simplifies the interface between your application and the web server. Outside of that, it mostly stays out of your way, so if you need to write an application that can scale, Flask is not going to prevent it, and in fact, it will allow you to freely choose the components of your stack and not impose choices on you like big frameworks tend to do.
In this tutorial session, I will walk you through a list of typical patterns for medium and large applications written in Flask, specifically chosen to highlight scalability patterns and best practices that you will be able to transfer to your own projects. The class will be divided in two main sections, dedicated to scalability of the code (i.e. how to write large applications with Flask) and scalability of the deployed application (i.e. how to handle large numbers of clients).
- Introduction (10 min)
- Large applications (1 hour)
- How to structure a large application
- Using Blueprints to organize an application
- Decorators as a way to simplify application code
- Combining a web application with a REST API
- API versioning
- Flask under load (1 hour)
- Asynchronous requests
- Using a Celery job queue
- Using multiple processes and hosts with a load balancer
- Using coroutine frameworks such as eventlet or gevent
- Using WebSocket for server-push and reduced latency
- Free-form Discussion and Q&A (50 min)
I hope this additional information helps you decide if you want to attend. And by the way, I'm only starting to prepare the material for this class, so I'm happy to accept suggestions for topics I may have not included that fit the theme of the class.
I hope to see you in Portland, either at my tutorial or around the conference!