Configuration

Simple Aircraft Manager is configured via environment variables. Development uses settings.py (SQLite, DEBUG=True). Production uses settings_prod.py, which requires DJANGO_SECRET_KEY and DJANGO_ALLOWED_HOSTS — it will crash intentionally if they are missing.

Required for Production

Variable

Description

Example

DJANGO_SECRET_KEY

Django secret key

Random 50+ character string

DJANGO_ALLOWED_HOSTS

Comma-separated allowed hosts

app.example.com,localhost

Generate a secret key:

python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'

General

Variable

Default

Description

DJANGO_DEBUG

False

Enable debug mode

DJANGO_CSRF_TRUSTED_ORIGINS

Trusted origins for CSRF (e.g., https://app.example.com)

TZ

UTC

Timezone

AIRCRAFT_CREATE_PERMISSION

any

Who can create or import aircraft: any (all authenticated users), owners (existing owners + admins), or admin (admins only)

Database

Variable

Default

Description

DATABASE_ENGINE

sqlite3

postgresql or sqlite3

DATABASE_NAME

aircraft_manager

Database name

DATABASE_USER

postgres

Database user

DATABASE_PASSWORD

Database password

DATABASE_HOST

localhost

Database host

DATABASE_PORT

5432

Database port

Superuser Auto-Creation

Variable

Default

Description

DJANGO_SUPERUSER_USERNAME

Create superuser on startup if set

DJANGO_SUPERUSER_PASSWORD

Superuser password

DJANGO_SUPERUSER_EMAIL

admin@example.com

Superuser email

Aircraft Import / Export (Optional)

Controls behaviour for the .sam.zip import/export feature.

Variable

Default

Description

IMPORT_STAGING_DIR

<BASE_DIR>/import_staging

Temporary directory for staged upload files while import validation and processing runs

IMPORT_MAX_ARCHIVE_SIZE

10737418240 (10 GiB)

Maximum allowed uncompressed archive size in bytes. Archives exceeding this limit are rejected during validation.

OIDC Authentication (Optional)

OIDC is disabled by default. Set OIDC_ENABLED=true to enable.

Variable

Default

Description

OIDC_ENABLED

false

Enable OIDC authentication

OIDC_RP_CLIENT_ID

OIDC client ID (required if enabled)

OIDC_RP_CLIENT_SECRET

OIDC client secret (required if enabled)

OIDC_OP_DISCOVERY_ENDPOINT

OIDC discovery endpoint URL

OIDC_RP_SIGN_ALGO

RS256

Token signing algorithm

OIDC_RP_SCOPES

openid email profile

OIDC scopes

OIDC_TOKEN_EXPIRY

3600

Token expiry in seconds

When enabled, OIDC and local Django accounts coexist. Users are auto-created on first OIDC login using preferred_username → email local part → sub as the username.

AI Logbook Import (Optional)

Enables AI-assisted transcription of scanned maintenance logbook pages.

Variable

Default

Description

ANTHROPIC_API_KEY

Anthropic API key (enables Claude models)

OLLAMA_BASE_URL

Ollama instance URL (enables self-hosted models)

OLLAMA_TIMEOUT

1200

Ollama request timeout in seconds

LOGBOOK_IMPORT_DEFAULT_MODEL

(built-in)

Default model ID for import

LOGBOOK_IMPORT_EXTRA_MODELS

JSON array of additional model definitions

LOGBOOK_IMPORT_EXTRA_MODELS format:

[{"id": "llama3.2-vision", "name": "Llama 3.2 Vision", "provider": "ollama"}]

If neither ANTHROPIC_API_KEY nor OLLAMA_BASE_URL is set, the logbook import feature is inactive.

Plugin System (Optional)

Variable

Default

Description

SAM_PLUGIN_DIR

/plugins

Directory scanned for plugin packages at startup. Any subdirectory containing __init__.py is treated as a plugin module and added to INSTALLED_APPS.

SAM_PLUGINS

Comma-separated Python module names to add directly to INSTALLED_APPS (useful when the plugin is installed as a package and you only need to name the module).

SAM_PLUGIN_PACKAGES

Comma-separated pip requirement specifiers installed at container startup before migrations run (e.g. my-sam-plugin==1.2.0,other-plugin>=0.5). Triggers collectstatic automatically.

See plugins.md for the complete plugin development guide.

Per-Aircraft Feature Flags

Variable

Default

Description

DISABLED_FEATURES

Comma-separated feature keys to disable globally for all aircraft. Disabled features cannot be re-enabled per aircraft by owners. Valid keys: flight_tracking, oil_consumption, fuel_consumption, oil_analysis, airworthiness_enforcement, sharing.

Example — disable oil analysis and fuel tracking instance-wide:

DISABLED_FEATURES=oil_analysis,fuel_consumption

See feature-flags.md for the full feature flag reference.

Testing Configuration

Verify production settings without a live database:

DJANGO_SECRET_KEY=test DJANGO_ALLOWED_HOSTS=localhost python manage.py check --settings=simple_aircraft_manager.settings_prod