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 |
Random 50+ character string |
|
Comma-separated allowed hosts |
|
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 |
|---|---|---|
|
|
Enable debug mode |
|
— |
Trusted origins for CSRF (e.g., |
|
|
Timezone |
Database¶
Variable |
Default |
Description |
|---|---|---|
|
|
|
|
|
Database name |
|
|
Database user |
|
— |
Database password |
|
|
Database host |
|
|
Database port |
Superuser Auto-Creation¶
Variable |
Default |
Description |
|---|---|---|
|
— |
Create superuser on startup if set |
|
— |
Superuser password |
|
|
Superuser email |
OIDC Authentication (Optional)¶
OIDC is disabled by default. Set OIDC_ENABLED=true to enable.
Variable |
Default |
Description |
|---|---|---|
|
|
Enable OIDC authentication |
|
— |
OIDC client ID (required if enabled) |
|
— |
OIDC client secret (required if enabled) |
|
— |
OIDC discovery endpoint URL |
|
|
Token signing algorithm |
|
|
OIDC scopes |
|
|
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 (enables Claude models) |
|
— |
Ollama instance URL (enables self-hosted models) |
|
|
Ollama request timeout in seconds |
|
(built-in) |
Default model ID for import |
|
— |
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.
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