Skip to content

Configuration

AMSDAL Framework configuration. All settings can be set via environment variables prefixed with AMSDAL_ or in a .env file.

from amsdal.configs.main import settings

Application Settings

Setting Type Default Description
APP_PATH Path Path('.') Path to the app directory
CONFIG_PATH Path \| None None Path to config.yml. Defaults to APP_PATH/config.yml
APP_CONFIG str 'app.MainAppConfig' User application config class path
CONTRIBS list[str] ['amsdal.contrib.auth.app.AuthAppConfig', 'amsdal.contrib.frontend_configs.app.FrontendConfigAppConfig'] Contrib modules to load (comma-separated string in env)

Module Paths

Setting Type Default Description
USER_MODELS_MODULE str 'models' Models module name
USER_MODELS_MODULE_PATH Path \| None None Explicit path to models module
FIXTURES_MODULE_NAME str 'fixtures' Fixtures module name
FIXTURES_MODULE_PATH Path \| None None Explicit path to fixtures module
STATIC_MODULE_NAME str 'static' Static files module name
STATIC_MODULE_PATH Path \| None None Explicit path to static module
TRANSACTIONS_MODULE_NAME str 'transactions' Transactions module name
TRANSACTIONS_MODULE_PATH Path \| None None Explicit path to transactions module
MIGRATIONS_DIRECTORY_NAME str 'migrations' Migrations directory name
MIGRATIONS_MODULE_PATH Path \| None None Explicit path to migrations directory

File Storage

Setting Type Default Description
MEDIA_ROOT Path Path('./media') Root directory for media file storage
MEDIA_URL str '/media/' URL prefix for media files
DEFAULT_FILE_STORAGE str 'amsdal_models.storage.backends.db.DBStorage' Default file storage backend class

Authentication & Cloud

Setting Type Default Description
ACCESS_KEY_ID str \| None None Access key from registration
SECRET_ACCESS_KEY str \| None None Secret access key from registration
ACCESS_TOKEN str \| None None Access token from sign-in
SANDBOX_ENVIRONMENT bool \| None None Use sandbox (True) or cloud (False) environment

PII Encryption

Setting Type Default Description
PII_CRYPTOR_BASE_URL str '' Base URL for PII Cryptor service
PII_CRYPTOR_CLIENT_ID str '' Client ID for PII Cryptor service

Contrib Module Settings

Setting Type Default Description
CONTRIB_MODELS_PACKAGE_NAME str 'models' Package name for contrib models
CONTRIB_MIGRATIONS_DIRECTORY_NAME str 'migrations' Directory name for contrib migrations
CORE_MODELS_MODULE str 'amsdal.models.core' Core models module
TYPE_MODELS_MODULE str 'amsdal.models.types' Type models module

Computed Properties

Property Return Type Description
user_models_path Path Root path for models directory
fixtures_root_path Path Root path for fixtures directory
static_root_path Path Root path for static files directory
transactions_root_path Path Root path for transactions directory
migrations_root_path Path Root path for migrations directory

Auth Settings

Auth-specific settings (also prefixed with AMSDAL_):

Setting Type Default Description
ADMIN_USER_EMAIL str \| None None Admin user email created on startup
ADMIN_USER_PASSWORD str \| None None Admin user password created on startup
AUTH_JWT_KEY str \| None None Key for JWT token signing
AUTH_TOKEN_EXPIRATION int 86400 Token expiration in seconds (24h)
REQUIRE_DEFAULT_AUTHORIZATION bool True Require authentication by default
REQUIRE_MFA_BY_DEFAULT bool False Require MFA for all users
MFA_TOTP_ISSUER str 'AMSDAL' Issuer name in TOTP authenticator apps
MFA_BACKUP_CODES_COUNT int 10 Number of backup codes per user
MFA_EMAIL_CODE_EXPIRATION int 300 Email MFA code expiration in seconds (5 min)