cPanel hosts that support Python usually do it with Setup Python App (CloudLinux). It gives every app its own virtual environment and serves it through WSGI, so you get Django or Flask online without configuring Gunicorn, Nginx or systemd yourself. Here is the full path from a local project to a live HTTPS site.
1. Upload the project
Put the code in a folder outside public_html, e.g. /home/youruser/myproject, with File Manager, SFTP or git clone over SSH. Leave your local venv and __pycache__ folders out — the server builds its own.
2. Create the application
Open Setup Python App → Create Application:
- Python version — the one you develop with (check
python --version). - Application root —
myproject. - Application URL — your domain or a sub-path.
- Application startup file —
passenger_wsgi.py(cPanel creates it for you). - Application entry point —
application.
3. Point passenger_wsgi.py at your app
For Django, replace the generated file's content with:
import os, sys
sys.path.insert(0, os.path.dirname(__file__))
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
For Flask, if your app object lives in app.py:
import sys, os
sys.path.insert(0, os.path.dirname(__file__))
from app import app as application
4. Install requirements
Add requirements.txt in the Configuration files box and press Run Pip Install, or copy the source …/bin/activate && cd … command shown on the page into SSH and run pip install -r requirements.txt. Packages that need compiling (for example mysqlclient) may need PyMySQL instead on shared hosting.
5. Django: settings, static files, migrations
- Set
DEBUG = Falseand add your domain toALLOWED_HOSTS. - Set
STATIC_ROOTto a folder insidepublic_html(e.g./home/youruser/public_html/static) and runpython manage.py collectstatic, so images, CSS and JS are served directly by the web server. - Create a database in MySQL Databases (host
localhost, names prefixed with your account) and runpython manage.py migrate. - Keep secrets in Environment variables on the app page, not in
settings.py.
6. Restart and test
Press Restart after every code or settings change. If you see a 500 error or "Incomplete response received from application", the app failed to import: run python passenger_wsgi.py inside the activated environment over SSH to see the traceback, and check stderr.log in the application root.
FastAPI and other ASGI apps
The app server speaks WSGI, so FastAPI needs a small ASGI-to-WSGI adapter (such as a2wsgi) in passenger_wsgi.py. It works well for typical APIs; for heavy WebSocket use a VPS is a better fit.
Prefer not to do it yourself?
Droxin Python hosting runs on fast NVMe servers, and our engineers set up the first deployment with you — and fix it if it breaks. Already deployed somewhere and stuck on an error? Send us the site; you pay only after it works.