Python
Detected from requirements.txt, Pipfile, or pyproject.toml.
Step-by-step deploy guides: Python, Django, Flask, FastAPI, Streamlit.
See Buildpacksfor how detection and version policy work.
Detects
requirements.txt, Pipfile, or pyproject.toml in the base directory.
Versions
Default is Python 3.13. Published lines as of September 2026: 3.10-3.14. You get the latest patch of the requested minor.
Pin, in this order:
.python-versionruntime.txt(python-3.12is fine)requires-pythoninpyproject.toml(a range picks the highest matching published version)
Install and build
poetry.lock: Poetry,poetry install --only mainPipfile.lock: Pipenv,pipenv install --deploy --systemrequirements.txt:pip install -r requirements.txtpyproject.tomlwith[tool.poetry]and no lockfile: Poetry- Otherwise:
pip install .
The builder installs pip, Poetry and Pipenv at pinned versions that run on every supported Python version. We bump them regularly; deploying without cache gets your app the current ones.
Django apps (manage.py plus a Django dependency) run collectstatic --noinput. A failure there is logged and does not fail the build.
Launch sets PYTHONUNBUFFERED=1. Django also gets DJANGO_ENV=production and, when a */wsgi.py file exists, DJANGO_SETTINGS_MODULE.
Start command
- Django:
gunicorn <dir>.wsgi --bind 0.0.0.0:$PORT --workers 3 - FastAPI / Starlette:
uvicorn main:app --host 0.0.0.0 --port $PORT(orapp:appif that file holds the app) - Flask: Gunicorn on
app:app,application:app, orwsgi:app - Otherwise
python app.pyorpython main.py
Put gunicorn or uvicorn in your dependencies if you rely on those defaults. Override with a Procfile. Listen on PORT.
If none of these match, the Procfile has to define the processes: at least one valid line other than release:, for example web: or worker:. Otherwise the build fails with an error instead of serving the app directory. A worker-only app (a bot, for example) without a web: line needs its own process: on the Processes tab, create a process named like the Procfile entry (for example worker, without a port) and set the web process to 0 instances.