Learn how to build Python Web Apps from our 6-part series!
Know a little Python and want to build web applications with Python backends? We’ve got you covered! We put on a 6-part series in June walking through the basics of web apps, the most popular Python frameworks (Flask, Django, FastAPI), containerization with Docker, deployment to Azure, and testing tools (Playwright, pytest). Follow the links below to watch those recordings and follow along at your own pace with our open-source sample projects!
If you’re a teacher, you can adapt the slides and projects for your students. You can get the editable versions from the slides repository.
Python Web Apps 101
An overview of the world of backend web development. Review the basics of HTTP and then learn how to make a Flask web application with routes, parameters, and templating. Discover how to turn that Flask application into an asynchronous application with Quart, for better concurrency.
:link: Helpful links:
Databases & ORMs
Discover how to add relational databases to a Python web app, using PostgreSQL and the popular SQLAlchemy ORM. Learn how to do migrations and use VS Code to explore the databases locally.
:link: Helpful links:
Slides
PostgreSQL playground
Flask + PostgreSQL project
RAG with PostgreSQL project
PostgreSQL + Azure project
Flask + PostgreSQL + Azure project
Django
Dive into the Django framework, a highly opinionated and very popular framework for Python web apps. Explore how the Django ORM and built-in admin makes it easy to build database-driven websites, using PostgreSQL as an example database.
:link: Helpful links:
Slides
Django + PostgreSQL project
Django + PostgreSQL + Azure project
FastAPI
Learn all about making HTTP APIs using FastAPI, the hottest new framework for Python web apps. Explore what makes FastAPI apps so “fast” and see the amazing auto-generated documentation.
:link: Helpful links:
Slides
Simple FastAPI project
FastAPI + PostgreSQL
FastAPI + Azure Functions
FastAPI + Azure Functions + APIM
Containerization with Docker
An introduction to Docker, a standard way to make your web application environments replicable and portable. Learn how to containerize Flask, Django, and FastAPI apps, and how to deploy containerized apps to clouds like Azure.
:link: Helpful links:
Slides
Simple Flask container project
Flask + DB container project
Testing with Pytest and Playwright
Learn how to use the popular pytest framework to write tests, plus bring in Playwright for browser based testing. Find out how to set up a CI on GitHub actions to automate tests and test coverage checks.
:link: Helpful links:
Slides
Pytest exercise
FastAPI + pytest project
FastAPI + DB + pytest project
Microsoft Tech Community – Latest Blogs –Read More