Skip to main content

Requirements

  • Python 3.11+ installed locally
  • Account on Vertra Cloud
  • requirements.txt file at project root

Project Structure

my-django-project/
├── manage.py
├── my_project/
│   ├── __init__.py
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
├── my_apps/
│   ├── models.py
│   ├── views.py
│   └── urls.py
├── requirements.txt
└── vertracloud.config

Configuration

requirements.txt

django==4.2.0
gunicorn==21.2.0
psycopg2-binary==2.9.9
python-decouple==3.8
whitenoise==6.5.0
The platform automatically runs pip install -r requirements.txt. Do not include venv or __pycache__ in the upload.

settings.py

Configure your settings.py for production:
import os
from pathlib import Path
from decouple import config

BASE_DIR = Path(__file__).resolve().parent.parent

# Security
SECRET_KEY = config('SECRET_KEY', default='dev-key-change-in-production')
DEBUG = config('DEBUG', default=False, cast=bool)
ALLOWED_HOSTS = config('ALLOWED_HOSTS', default='*').split(',')

# Applications
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'my_apps',
]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'whitenoise.middleware.WhiteNoiseMiddleware',  # Add WhiteNoise
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
]

ROOT_URLCONF = 'my_project.urls'

# Database
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': config('DB_NAME', default='postgres'),
        'USER': config('DB_USER', default='postgres'),
        'PASSWORD': config('DB_PASSWORD', default=''),
        'HOST': config('DB_HOST', default='localhost'),
        'PORT': config('DB_PORT', default='5432'),
    }
}

# Static files
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'

# HTTPS
SECURE_SSL_REDIRECT = not DEBUG
SESSION_COOKIE_SECURE = not DEBUG
CSRF_COOKIE_SECURE = not DEBUG

vertracloud.config

MAIN=manage.py
START=gunicorn --bind 0.0.0.0:$PORT my_project.wsgi:application
VERSION=recommended
Before deployment, run python manage.py collectstatic --noinput locally to compile static files.

Deploy

  1. Execute python manage.py collectstatic --noinput locally
  2. Exclude venv, .cache, db.sqlite3 and __pycache__ from the project
  3. Compress into a ZIP file
  4. Access Dashboard → New Project → Application
  5. Select Python language and upload
  6. Configure memory (512MB recommended for Django)
  7. Click “Create Application”

Available Versions

VersionStatusDescription
3.13RecommendedPython 3.13 LTS (recommended for production)
3.13LatestLatest available version
3.12StablePython 3.12 with extended support
3.11LegacyPython 3.11 with limited support

Notes

  • Production server: Use gunicorn to serve the Django application
  • Static files: Run collectstatic and configure WhiteNoise before deployment
  • Database: Configure psycopg2-binary for PostgreSQL
  • Migrations: Run python manage.py migrate before first deployment
  • Environment variables: Configure SECRET_KEY, database credentials and DEBUG=False
  • Auto-restart: Enabled by default