Guide: How to Deploy a Python (Django/Flask) App
Our Python Selector allows you to run modern frameworks like Django, Flask, or FastAPI with full control over your virtual environment.
1. Create the Environment
-
Log in to cPanel and click Setup Python App.
-
Click Create Application.
-
Choose your Python Version (e.g., 3.11 or 3.12).
-
Application root: Enter your project folder (e.g.,
my_flask_app). -
Application URL: Select your domain and leave the path blank for the root.
-
Application startup file: For Flask, this is usually
app.py. For Django, it ispassenger_wsgi.py. -
Click Create.
2. Install Dependencies
-
Open your cPanel File Manager and upload your
requirements.txtinto the application root folder. -
Go back to Setup Python App and click Edit on your application.
-
In the Configuration files section, type
requirements.txtand click Add. -
Click the Run Pip Install button.
3. Special Note for Django
If you are running Django, you must run your migrations. Copy the Command for entering to virtual environment at the top of the page, paste it into the cPanel Terminal, and run: python manage.py migrate