- Documentation
- Technologies
- Python
Python
Guara Cloud fully supports Python applications, including frameworks like Django, Flask, FastAPI, and any other Python-based project.
Supported versions
The following Python versions are auto-detected:
- Python 3.10
- Python 3.11
- Python 3.12
The version is auto-detected from your project configuration files (e.g., pyproject.toml, Pipfile, or .python-version). If no version is specified, the latest stable version is used.
Deploy with Dockerfile
For full control over your build, provide a Dockerfile in the root of your repository.
Deploy with Buildpack
If your repository does not contain a Dockerfile, Guara Cloud automatically detects your Python project by the presence of a requirements.txt, pyproject.toml, Pipfile, or similar dependency file.
The auto-detection will:
- Detect the Python version from your project configuration
- Detect your package manager (pip, poetry, pdm, uv, or pipenv) and install dependencies accordingly
- Detect your framework (Django, Flask, or FastAPI)
- Auto-configure the production server — gunicorn for Django/Flask, uvicorn for FastAPI
- Start your application automatically
No Procfile is needed — the framework and server are detected and configured for you.
Port configuration
Your application must listen on the port configured in your service settings. The default is 3000, but you can change it at any time to match your application.
import os
port = int(os.environ.get('PORT', 3000))
Example project structure
my-python-app/
requirements.txt
runtime.txt # optional — specify Python version if needed
app.py
src/
routes.py
models.py
Dockerfile # optional — omit to use Buildpack
Environment variables
These environment variables are commonly used with Python deployments:
| Variable | Recommended value | Description |
|---|---|---|
PYTHONUNBUFFERED | 1 | Ensures logs are output in real time without buffering |
PORT | Set by platform | The port your application must listen on |
PYTHONDONTWRITEBYTECODE | 1 | Prevents Python from writing .pyc files |