The first part focuses on those core pieces:
- View functions
- Jinja templates
- Forms
- Sessions
- Static files
- Flash messages
- Logging
Additionally, you'll learn how to write tests for a Flask application using pytest.
Learning Objectives
- Utilize Python 3 and Flask to create a web application
- Create view functions for handling requests to specific URLs (routes)
- Utilize the Jinja templating engine to add logic when generating HTML
- Process form data in a view function using the
request proxy
- Store and retrieve data in a session for use between requests
- Write tests using pytest
- Utilize static files (sylesheets, images) for enhancing the look and feel of the app
- Create flash messages for displaying information to the user
- Log messages to a file to understand the operations of the web app
The second part focuses on structuring a Flask application using blueprints.
In this part, you'll learn how to create different configurations for different environments -- e.g., development, testing, and production. We'll dive into how the Application Factory design pattern can be applied to Flask to easily create a Flask application as well.
This part also provides a deep-dive into how Flask processes requests and how the application and request contexts are handled during a request.
Finally, you'll learn how fixtures in pytest can help create the initial state for running tests.
Learning Objectives
- Organize a Flask project into blueprints
- Create multiple configurations for your development, production, and testing environments
- Create an application factory function for initializing a Flask app
- Describe the steps for processing a request in Flask
- Explain how the application and request contexts work during request processing
- Utilize fixtures to help initialize the state for running tests
The third part focuses on using Flask-SQLAlchemy to:
- create models for the tables in the database
- store and retrieve data in the database
In addition, we'll look at how to create custom CLI commands in Flask to populate the database with data.
Learning Objectives
- Create a SQLite database to store data
- Utilize Flask-SQLAlchemy to interact with the SQLite database
- Create custom CLI commands for populating data into the database
Starting with the fourth part, we'll utilize Test-driven Development (TDD) to incrementally add functionality to the Flask app.
This part focuses on managing the users of the app:
- Registering new users
- Logging users in and out
- Sending emails with Flask-Mail
- Confirming users' email addresses using unique links emailed to them
- Implementing 'forgot your password' functionality
- Presenting a user profile page
In addition, you'll learn about how to mitigate CSRF and XSS attacks.
Learning Objectives
- Utilize TDD to incrementally add functionality to a Flask app
- Handle user registration in Flask
- Explain how to mitigate CSRF and XSS attacks in Flask
- Send emails using Flask-Mail
- Confirm users' email addresses using unique links emailed to them
- Implement 'forgot your password' functionality
- Create a user profile page
The fifth part focuses on working with stock data.
We'll look at how to display the stock portfolio for each user and how to add new stocks.
You'll learn about monkeypatching for testing an external API. Then, we'll dive into pulling in stock data from an external API.
This part culminates with creating charts of the historical stock prices using Chart.js.
Learning Objectives
- Display and add stocks to a user's portfolio
- Utilize monkeypatching to test working with an external API
- Retrieve stock data from an external API
- Display charts of stock prices using Chart.js
The sixth part focuses on deploying the app to Render.
Learning Objectives
- Deploy a Flask app to Render.