Course Overview

Geared for experienced Python developers, Developing Web Applications with Flask is a hands-on Flask training course that provides students with the core skills required to create professional web applications with the Flask microframework.

This course is approximately 40% hands-on lab to 60% lecture ratio, combining expert lecture, real-world demonstrations and group discussions with machine-based practical labs and exercises.  Our engaging instructors and mentors are highly experienced practitioners who bring years of current "on-the-job" experience into every classroom.

Key Learning Areas

  • Create complete Flask applications
  • Work with session data
  • Design Jinja templates using inheritance
  • Integrate a SQLite database
  • Test and debug Flask applications

Course Outline

Overview of Flask

  • Origins and purpose
  • Views, controllers, but no models
  • What Flask can and cannot do

Diving Right In

  •  A simple application
  • Configuring routes
  • Defining view functions
  • Deploying the application

Simple Views

  • HTTP Methods
  • Returning content
  • Templates and variables

Organizing the Application

  • Configuring routes
  • Static files22
  • Configuration
  • Context locals
  • Sessions

Integrating a Database

  • The g (global) object
  • Creating a table
  • Inserting rows
  • Making queries
  • Walkthrough of minor changes necessary for integrating other databases (SQL Server, Oracle, MySQL, etc.)

Jinja Templates

  • The big picture
  • Simple syntax
  • Block statements
  • Loading and rendering
  • Inheritance
  • Advanced syntax
  • Filters and tests

HTTP Responses

  • String responses
  • Setting the status code
  • Getting the response object
  • Adding response headers

HTML Forms

  • Simple forms
  • Form submission
  • Retrieving user data
  • Re-submitting forms

Advanced Views

  • Redirects
  • Auto-escaping HTML
  • Message flashing
  • Built-in decorators

Error Handling

  • Handling an unrouted URL
  • Aborting a page view
  • Customizing the error page

Testing and Debugging

  • Using unittest
  • Simple tests
  • Accessing sessions
  • Mocking resources

Advanced Topics

  • Custom filters and tests
  • Class-based views
  • Support for JSON
  • Blueprints

Who Benefits

This introductory-level course is geared for experienced Python developers who want to use Python and Flask for web development projects. Attendees should have working experience with Python basics, as well as basic skills working with HTML5 and CSS3. JavaScript is not required.

Our Python tracks include a wide variety of follow-on courses and learning paths for leveraging Python for next-level web development, data science / machine learning, networking, task automation, security, and other topics.

Prerequisites

Attendees should have working experience with Python basics, as well as basic skills working with HTML5 and CSS3. JavaScript is not required.