
Learn how routes define an app's endpoints in Flask and map URLs to functions with app.route. Return html or json responses, including dictionaries, to serve data.
Learn how Flask routes specify HTTP methods, defaulting to GET; use a methods list or decorators like app.get and app.post to enable GET and POST requests.
Learn how to implement route variables in Flask by defining dynamic endpoints with angle brackets, mapping them to function parameters, and supplying defaults for missing input.
Learn to send json data using Postman, configure http requests with post and other methods, and build a Flask endpoint that accepts and returns json via request.get_json.
Render conditional blocks in templates (home.html) using if, elseif, and else with a passed number. Display messages for greater than 20, ten to 20, or ten or less.
Learn how to loop over data in Flask templates by passing a list of dictionaries and iterating with for item in data, accessing item.key to render multiple values.
Create a user table with SQLAlchemy by defining a class that inherits from db.Model, and declare id as primary key, a name string, and a date joined datetime.
Update data in SQLAlchemy by querying the first user, changing the name to Flask user, and committing the session to persist changes, demonstrated via a Flask shell workflow.
Define a one-to-many relationship by adding an order model with a total field that links to a user via a foreign key, exposing related data through db.relationship and back_populates.
Learn to implement a many-to-many relationship in Flask using an association table order_product, with composite primary keys, foreign keys, and SQLAlchemy relationships via secondary and back_populates.
Learn to query a many-to-many relationship in Flask using Flask-SQLAlchemy, fetch orders, and list associated product names for each order.
Explore querying all data from a model using SQLAlchemy, retrieving all users, counting records, and applying filters to narrow results.
Organize a Flask project with a modular structure by separating routes, models, and extensions into dedicated files, importing blueprints, and configuring via environment-driven settings.
Install Flask, Flask SQLAlchemy, and python-dotenv, then move the form to the templates directory and render form.html via a blueprint.
Initialize the Flask database by configuring the db object in create app, set the SQLAlchemy database URI in the dot env file to a SQLite database, and call db.create_all.
Seed language and topic data in flask app by creating languages (python, javascript, php, ruby, c, go) and topics (web apps, mobile apps, APIs), push app context, add all, and commit.
Explore how to verify form data in Flask by creating a route that handles get and post, names inputs, submits to index, and prints form fields and checkbox values.
Query languages and topics from the database, pass them to the template via a context dictionary, and render a dropdown and checkboxes that reflect database values, saving to the database.
Learn how to update or create member records in a Flask app by checking existence, updating email, password (hashed), location, dates, interests, and topics, with redirects.
Learn how to add an API to our registration format and use Postman to send requests and inspect the API's responses.
Organize files by creating a separate api blueprint. Move the views into a views folder and rename the file to main.py, then adjust imports and paths.
Install Flask, Flask-SQLAlchemy, and a Python env, set up templates and static files, and build an app factory with main and auth blueprints for index, login, register, and orders.
Create flask-sqlalchemy models for a dashboard by configuring extensions.py, sqlite database URI, and building customer, product, and order with foreign keys and revenue goals.
Learn to seed a Flask app database by creating three sample products and generating faker-based orders with CLI commands, queries, and random data.
Build a revenue per product query by joining the order table and the product table, multiply quantity by price, and group by product ID to summarize revenue by product.
learn to compute revenue this month per product by building a product method, filtering orders from the first of the month with a SQLAlchemy query and scalar result.
Write queries to fetch today's order count and monthly earnings, using a beginning of day filter and static methods for orders and revenue per product.
Wire orders today and earnings data into your Flask dashboard template by importing models, creating context, and iterating monthly and yearly totals for display.
Learn to render an area chart by extracting the last 12 months of monthly earnings in Flask, passing the data to JavaScript, and rendering it with the area chart function.
Create a revenue per product and total revenue view using a pie chart, mapping product names to labels and calculating percentages for the template data.
Unify the pie chart colors by applying a single color and aligning the hover effect. Round the revenue per product data before sending it to JavaScript to display rounded numbers.
Learn to implement form validation in a Flask app by checking email existence, enforcing password matches, and displaying clear error messages in the login and register forms.
Explore the starting HTML files for a Flask app: home, daily food log, and add food pages. See how Bootstrap layouts will later be converted into templates for Flask.
Create a database for the Flask app with three tables: log dates, food, and food date, then connect to the database and prepare to enter and retrieve data.
Learn to add food items to the database using a Flask form, handling get and post requests and passing name, protein, carbohydrates, and fat.
Move the database call above the if statement to use it in the post block, then insert the selected food and date into the food date table and commit.
Learn to compute sum totals per day by building a group by query on log date, summing protein, carbohydrates, fats, and calories with aliases in Jade for a Flask app.
Update links across templates to correct routes, including home, food, and add food item. Verify navigation by testing from home to food to item details to ensure all links work.
Refactor this lecture demonstrates moving database functions to a separate database.py, importing them, creating a base template to streamline flask templates, and tidying long queries with multi-line formatting.
deploy a flask app on amazon lightsail by provisioning an ubuntu instance, installing engine X, configuring a proxy to unicorn, and creating a python virtual environment with Flask.
Demonstrates deploying a Flask app to Amazon Lightsail server by pushing to GitHub, cloning on the server, updating the database path, and running with gunicorn, with cloud hosting alternatives.
Identify a bug where new dates don't appear due to inner joins; switch to left joins so dates show without matching food, then can be updated with food.
The lecture demonstrates building a question-and-answer app with user, expert, and admin roles in Flask, featuring a home screen of questions and answer workflows.
Discover the eight templates that power the app, including home, registration, log in, and admin views. Install Flask and convert these templates into dynamic Flask pages for questions and answers.
Set up a Flask app with a virtual environment, install Flask, organize templates and static css, and create routes rendering templates like register, login, question, answer, and users.
Set up Flask database helpers by connecting with get_db, importing it in app.py, and tearing down the connection after each request to prevent memory leaks.
Learn to build a register route in a Flask app, hash passwords with Werkzeug, insert new users into the database, and set admin flags for the initial admin user.
The admin user views a user setup page that fetches all users with a cursor, displays their name and expert status, and uses a promote route to update and redirect.
Learn to build the home route that displays all answered questions by joining the questions and users tables twice to show asker and expert names, with links to each question.
Update the question page by querying for a single question id, fetch one with a question cursor, and pass question text, answer text, asker, and expert names to the template.
Deploy a flask app to Heroku, configure a proc file, unicorn, git, and requirements.txt, then push for deployment and migrate from sequel Lite to Postgres.
Set a static secret key across all dynos on Heroku to keep sessions consistent, using an environment variable or a pre-generated value instead of runtime random keys.
Fetches a single member by id from the database using a select query and returns the member's id, name, email, and level, demonstrating retrieval consistency with the post route.
Delete a member by executing a delete from members where id equals the target, commit, and return a deletion confirmation while verifying with a get all request.
Implement a protected decorator in Flask to enforce authentication on every route, using wraps, handling args and kwargs, and validating API username and password before permitting access.
Welcome to The Ultimate Flask Course. This course is designed to teach you everything you need to know to get started building your own Python-based web apps using the Flask framework. I will teach you the basics of Flask and show you some examples of how to build apps using only the features of the Flask framework itself. Then I will teach you various useful extensions that you can use to make adding more powerful features to your Flask apps much easier and show you example apps using those extensions.
You'll learn:
How to build Python web apps with Flask
How to use the Jinja template language to create the look of your apps
How to use the SQLite database to start development
How to use other databases with Flask by using Flask-SQLAlchemy
Using Flask to process incoming request data
How to build an API with Flask
Handle user sessions
How to build working apps with six app examples
In this course, we'll cover popular Flask extensions, including:
Flask-SQLAlchemy
Flask-WTF
Flask-Bootstrap
Flask-Mail
Flask-Migrate
Flask-Uploads
Flask-Login
Flask-Admin
Flask-User
Flask-Babel
Flask-Restless
Flask-SocketIO
Flask-Security
What do you need to know before starting the course?
As long as you have some basic experience with Python, you are ready to take the course. It's helpful to know some basics of HTML as well.
I look forward to seeing you in the course and hearing your thoughts.