Advanced level · Module 6: Python Capstone: Deploying a Real Application · Lesson 3 of 5
Deploying a Python Application
Run the application on a hosting service with production configuration.
In this lesson you will
- Deploy to a Python-friendly host
- Configure environment variables and a production database
Key concepts
deploymentWSGI serverenvironment configurationlogs in production
The lesson
Deploying means running your application on a server so others can use it. Free and low-cost Python hosts run a Flask app from a Git repository, using requirements.txt to install packages.
Production is different from your laptop: use a proper WSGI server rather than the development server, set secrets as environment variables on the host and turn debug off.
After deploying, verify: run your request collection against the live URL, check the logs and note the exact version deployed.
Step by step
- Prepare requirements.txt and a start command.
- Create the app on the hosting service and connect the repository.
- Set environment variables for secrets.
- Run your request collection against the live URL.
Practice activity
Deploy your Tested Inventory API (or capstone) to a free-tier Python host and verify it with your request collection.
Expected result: A publicly reachable deployment passing the request collection.
Check your understanding
-
Why not use Flask's development server in production?
Show answer
It is not designed for security, performance or reliability under real traffic.
Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.