How to run a Python app in cPanel (Flask, Django)
- Open "Setup Python App" (group "Software").
- Click "CREATE APPLICATION".
- "Python version" - the newest available.
- "Application root" - the code folder, for example
pyapp. - "Application URL" - domain and path.
- "Application startup file" -
passenger_wsgi.py, "Application Entry point" -application. - Click "CREATE".

The panel creates the folder, a virtual environment and a test passenger_wsgi.py. Upload your code and requirements.txt. Then open the app in the list, add requirements.txt in the configuration files block and run the pip install.
passenger_wsgi.py for Flask
from app import app as applicationHere app.py is the application file and app is the Flask object in it.
passenger_wsgi.py for Django
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
application = get_wsgi_application()Click "RESTART" in the app card after changing the code.