About My "Flask Workshop" Tutorial at PyCon 2015

Posted by
on under

In case you haven't heard, this year I will, once again, host a Flask class at PyCon in Montreal. The class is titled Flask Workshop, and is scheduled for Wednesday, April 8th from 9am to 12:20pm. For some reason not all the information I provided for this class has been published on the PyCon website, so in case you need some help deciding if this class is for you, I have all the details below.

Let's begin with the 10,000 foot view. This is the course description, straight from the PyCon tutorial page:

Flask is a web framework for Python based on Werkzeug, Jinja 2 and good intentions. It is considered a micro-framework, but don't get the "micro" part fool you; Flask can do everything others can do, many times in a simpler, leaner way. In this tutorial session we will build a web application together. Bring your laptop and your questions!

The class abstract, also published by PyCon, gives a little more information:

This is a class directed at Python beginners that are interested in learning Web development. In this workshop we are going to build a Web application using Flask, the Python Web micro-framework.

The only pre-requisite is that you have a basic knowledge of Python. I will be happy to explain anything you don't understand, but I will assume that you are at least familiar with the language syntax and structure.

We will start with the setup of a development environment for Flask in your laptop, and then will work on an application that we will build from scratch in small incremental steps. The main topics that I will cover in this class are Basic Applications, Templates, Web Forms and User Sessions. At the end I will also give you an overview of what you should focus on next.

Note that this year my intention is to cover the basic building blocks in very good detail, so this is a class that is ideal for beginners, or those that found my PyCon 2014 tutorial too intimidating. I will welcome questions at all times and also expect all the attendees will have the example application running on their laptops by the end of the class.

My hope is that this class will give you a really good taste of what Web development is. By the end of it you will have enough knowledge to build simple Web applications on your own, and if you are interested, you will know what you need to do to continue on your learning path.

Here you can see that unlike the tutorial I gave last year, this time I'm lowering the entry level considerably. Last year's class was for intermediate developers that needed just a little push to embrace Flask. This year I will cover a lot less ground and that will allow me to spend more time on the basics. Also this time I plan to have hands-on activities, unlike last year. I want all students to leave the class with a simple, yet complete web application running in their laptops.

I provided a class outline when I submitted my class proposal, but this was not made public. Here you can see what I'm planning to teach in even greater detail:

  • Introduction (15 min) Welcome and introduction to the class and the Flask microframework
    • Who am I
    • Why Flask
  • Set up (15 min) In this section I will help you set up your laptop for Flask development
    • Python
    • Virtual environments
  • Hello, Flask! (30 min) Here you will learn how to write and run basic Flask applications, learning a bit about the HTTP protocol on the way
    • Installing Flask
    • A simple application
    • Requests and responses
    • Dynamic routes
    • Q&A
  • Templates (30 min) In this section you will learn how to separate logic from presentation, to create applications that are nicely organized and easier to maintain
    • The Jinja2 template engine
    • Control structures in templates
    • Links between pages
    • Q&A
  • Web Forms (30 min) Here you will learn how to accept input from users through web forms
    • GET and POST requests
    • The Flask request object
    • Q&A
  • User sessions (30 min) In this part you will learn how to "remember" users as they navigate between pages of the application
    • Working with users and user-specific data
    • Q&A
  • What's Next (30 min) To end the class I will give you a realistic overview of what stands between what you have learned in class and the knowledge required to write fully featured applications
    • Databases
    • Client-side styling framework (Twitter Bootstrap or similar)
    • Working with larger applications
    • Unit testing
    • Deployment options
    • Q&A

Also, I included some tips for students on what to bring to class, and this was also left out of the class information published on the PyCon website:

This class is a workshop, I expect you will work along with me to get an application up and running on your machine. Here are some guidelines for what to bring:

  • Your laptop: any machine that runs Python is good. All operating systems accepted, so don't be afraid to bring your Windows laptop if that is what you have.

  • Python interpreter: you can choose between Python 3.4 or 2.7. If you have no preference, then I recommend 3.4, in particular for Windows users. Please have it installed and running on your laptop before coming to class.

  • Virtualenv: If you are running Python 2.7, please install virtualenv as well. On Mac, do sudo easy_install virtualenv. On Ubuntu, do sudo apt-get install python-virtualenv. Note that if you are working with Python 3.4 you do not need virtualenv. I recommend that Windows users install Python 3.4 for this reason, as virtualenv is tricky to install on that platform.

  • Wi-Fi: you will need to download and install a few things during class (but don't worry, it all goes to a private directory, you will not need to make any system changes to your laptop). I will try to have the software in a USB stick just in case as well.

  • Text editor: you can use your favorite text editor, but make sure you bring one you are comfortable with, because you will need to use it a lot. If you would like to use an IDE such as PyCharm that's fine too.

  • Terminal window: we will spend a good amount of time working in the command line prompt. Please familiarize yourself with the terminal or command window in your operating system.

  • Web browser: we will obviously test our application in a web browser. You can use any modern browser, so make sure you have your favorite one installed.

I hope this gives you a better idea of what my plans are for this class. I hope that if you are beginner, this class will give you enough of the foundations to be able to then use my book or the video of my PyCon 2014 class to continue on your learning path.

If you have any questions not answered in this article, let me know below in the comments. If you decide this class is for you, you can sign up by clicking on the following link:

https://us.pycon.org/2015/registration/register/

Thank you, and I hope to see you in Montreal. Even if you are not coming to my class, be sure to attend my book signing at the O'Reilly booth on Friday morning, and my talk on RESTful API design on Friday afternoon. You may also find me during conference breaks in the vicinity of the Rackspace or O'Reilly booths, so stop by to say hi if you want!

Miguel

Become a Patron!

Hello, and thank you for visiting my blog! If you enjoyed this article, please consider supporting my work on this blog on Patreon!

No comments yet

Leave a Comment