Stacks
Python
Deploy Django, Flask, FastAPI, Streamlit or any Python web app.
What we detect
requirements.txt, pyproject.toml or a Pipfile makes it a Python app. We recognise Streamlit, Django, Flask and FastAPI from your dependencies. The default port is 5000.
The most important setting is the start command: a production server listening on 0.0.0.0:$PORT. Set it in the project's Settings, or in a Procfile.
Flask
Don't deploy with app.run(debug=True)
Flask's development server listens on 127.0.0.1 only: the deploy fails with “listening on localhost”. Use gunicorn.
flask
gunicorngunicorn app:app --bind 0.0.0.0:$PORTDjango
python manage.py migrate --noinput && gunicorn myproject.wsgi --bind 0.0.0.0:$PORTimport os
ALLOWED_HOSTS = [".dockhosting.cloud", "your-domain.com"]
CSRF_TRUSTED_ORIGINS = ["https://*.dockhosting.cloud", "https://your-domain.com"]
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")For the database, read DATABASE_URL, for example with dj-database-url:
import dj_database_url
DATABASES = {"default": dj_database_url.config(conn_max_age=600)}FastAPI
uvicorn main:app --host 0.0.0.0 --port $PORTStreamlit
We find your Streamlit script and start it for you. To set it yourself:
streamlit run app.py --server.address 0.0.0.0 --server.port $PORTPython version
Pin it with a .python-version or runtime.txt file (for example 3.12).
