Python
Deploy Django, FastAPI, or Flask apps on DockHosting.
DockHosting detects a Python project from a requirements.txt or pyproject.toml at the repository root, installs dependencies, and starts your app.
Requirements
requirements.txt(pip) orpyproject.toml(Poetry / PEP 621) listing your dependencies- A way to start your app that DockHosting can run — for Django,
manage.py runserverisn't production-grade, so usegunicornoruvicornexplicitly (see below) - Your app bound to
0.0.0.0and thePORTenvironment variable, not a hard-coded port or127.0.0.1
Django
Run with Gunicorn rather than the development server:
gunicorn myproject.wsgi:application --bind 0.0.0.0:$PORTAdd gunicorn to requirements.txt. Run python manage.py migrate against your attached database before or during your first deploy — either from a one-off shell or as part of your start command.
FastAPI
Run with Uvicorn:
uvicorn main:app --host 0.0.0.0 --port $PORTFor production, --workers with Gunicorn managing multiple Uvicorn workers scales better under real load than a single Uvicorn process.
Flask
gunicorn app:app --bind 0.0.0.0:$PORTFlask's own built-in server (app.run()) is not meant for production traffic — use Gunicorn the same way as Django.
Databases
psycopg2 / psycopg (Postgres), mysqlclient or PyMySQL (MySQL/MariaDB), pymongo (MongoDB), and redis-py all accept the connection string DockHosting injects when you attach a database directly, or via your ORM's DATABASE_URL-style config (Django's dj-database-url, SQLAlchemy's create_engine(url)).
Environment variables
Read with os.environ["VARIABLE_NAME"] or os.getenv("VARIABLE_NAME"). Set them in your project's settings — see Environment variables.