Python hosting is the service for running applications written in Django, Flask, FastAPI, and other Python frameworks. Python has dominated data science and AI over the past decade and is widely used in web development too. But Python is poorly supported on shared PHP hosting โ special configuration is needed.
Python hosting options
cPanel Python Selector โ runs Python on shared hosting. Python 3.9, 3.10, 3.11 versions. Supported on Sayt.uz Pro+ tariffs.
VPS with Gunicorn or uWSGI โ full control, production-grade. Combine with Nginx reverse proxy.
PaaS โ Heroku, Railway, Render, PythonAnywhere โ specifically optimized for Python.
Docker โ run the Python app inside a Docker container.
Setting up cPanel Python Selector
1. cPanel โ "Setup Python App". 2. Pick a Python version. 3. Application Root (e.g., /home/user/myapp). 4. Application URL. 5. Application Startup File (passenger_wsgi.py or app.py). 6. Application Entry Point ("application" for Django, "app" for Flask). 7. Create.
A virtual environment is created automatically. Install dependencies via SSH or the "Run pip install" button: pip install -r requirements.txt.
Running Django
For a Django project a passenger_wsgi.py file is needed:
import os, sys
sys.path.insert(0, '/home/user/myapp')
os.environ['DJANGO_SETTINGS_MODULE'] = 'myapp.settings'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
Database โ Django defaults to SQLite, but use MySQL or PostgreSQL in production. Create a MySQL database via cPanel and add it to settings.py.
Static files โ in settings.py: STATIC_ROOT = '/home/user/public_html/static/', then run python manage.py collectstatic.
Gunicorn on VPS
Gunicorn is a Python WSGI server, faster than Apache mod_wsgi in production. On VPS: pip install gunicorn. Start: gunicorn --workers 4 --bind 0.0.0.0:8000 myapp.wsgi:application. Automatic startup via systemd service: /etc/systemd/system/gunicorn.service.
Sayt.uz practice
4% of Sayt.uz clients use Python (mostly Django, less Flask and FastAPI). Primarily data science startups, IT consulting, and custom CRM projects. cPanel Python Selector is supported on Pro+ tariffs (Python 3.9, 3.10, 3.11). VPS clients get a Gunicorn + Nginx setup from our sysadmins. Tip: Python web apps don't run well on shared hosting โ VPS or PaaS is the clear recommendation.