Web applications with Flask

Flask gives you a tiny core and lets you choose everything else, which is its strength and its trap. We build an application piece by piece, picking the extensions that earn their place, and finish with an API, tests and a deployment.

Duration: 3 days · Level: intermediate

For: Python developers who want to build web applications and services with Flask.

Prerequisites: the basics of Python; knowing what an HTTP request is helps.

Web applications with Flask

Day 1 — Flask fundamentals

  • An introduction to Flask: Flask vs Django
  • Installation and setup
  • Routes and views: route decorators
  • HTTP methods and URL variables
  • Redirections and errors
  • The request object: query parameters and form data
  • Responses, headers and cookies
  • Jinja2 templates: syntax and expressions
  • Filters, tests and control structures
  • Template inheritance and inclusion

Day 2 — Data and authentication

  • Forms with Flask-WTF: creation and validation
  • Custom validators
  • CSRF protection
  • File uploads
  • Databases with Flask-SQLAlchemy: configuration and models
  • Queries and relations
  • Migrations with Flask-Migrate
  • An automatic backend with Flask-Admin
  • Authentication with Flask-Login

Day 3 — Web API and production

  • Splitting a growing application with blueprints
  • Unit and integration tests
  • Setting up a task queue
  • Building a web API
  • To REST or not to REST
  • Handling static files
  • Going to production

Elevate Your Python Proficiency!