Docs menu
Getting started with Python
Deploy a minimal Django app to Primcloud end-to-end using a sample repo, in about five minutes.
On this page
Deploy a small Python web app to Primcloud: fork a sample Django repo, import it, watch the build, and open the app at its *.primcloud.app URL. It takes about five minutes.
Before you start#
You'll need:
- A Primcloud account. Standard accounts are $0 to create; compute is metered by the minute from the moment you deploy, starting around $5/mo for the smallest app.
- A git provider connected to your Primcloud account; see Source Control.
- Optional: Python 3.10 or newer installed locally, if you want to run the sample or make changes before deploying.
The sample app#
For this guide, use Heroku's heroku/python-getting-started repo. It's a minimal Django app with a Procfile, a requirements.txt, and a .python-version: everything the Primcloud Runtime needs to detect and deploy it with no changes. Fork it into an account you've connected to Primcloud.
1. Create the application#
Hit Import Git Repository on the applications list, then:
- Select your fork of
python-getting-started. - Configure the branch (
main) and a region. - Verify the commit and hit Import.
2. Deploy#
The first deployment starts as soon as the app is created, and its build log streams live:
- Detection. Primcloud sees
requirements.txtand.python-versionat the repo root and picks the Python toolchain. - Python install. The Python version listed in
.python-versionis installed. - Dependencies. The build creates a virtual environment, then runs
pip install -r requirements.txtagainst it. - Django hook. Because Django is a declared dependency and the repo has a
manage.py, the build automatically runspython manage.py collectstatic --noinputso static files are collected during the build. - Start. Primcloud reads the
Procfileand starts thewebprocess. The sample'swebline runsgunicorn --config gunicorn.conf.py gettingstarted.wsgi.
When the deployment's Rollout phase shows Complete, the app is live.
3. Reach the app#
Click the *.primcloud.app URL in the dashboard header to open the app.
If it doesn't come up:
- Deployments: the build log has the full output from the Python build, including pip's install output and any
collectstaticerrors. - Logs: runtime output from your app streams there, including any Gunicorn or Django startup errors.
- Confirm your app binds to the port in
$PORT. Primcloud sets this env var on thewebformation, and the sample'sProcfilepasses it through to Gunicorn automatically.
Where to go next#
- Deploying a different Python app: Python on Primcloud for detection, package manager selection, and the install and compile phases.
- Pinning to a specific Python version: Runtime versions.
- Switching to Poetry or uv, or using a private package index: Package managers.
- Adding a build hook or an OS-level library: Customizing the build.
- Django-specific quirks: Deploying Django.
- Flask instead: Deploying Flask.
- Something breaking: Troubleshooting Python.