Skip to main content

Settings and checks

Added in 1.0.1

Django settings​

SettingDefaultPurpose
CHASSIS_USERS_MODULE_ENABLEDTrueGlobally enable the built-in users runtime
CHASSIS_PERMISSION_CHECK'group_only'group_only or user_has_perm
CHASSIS_PERMISSION_NAME_NORMALIZATION_ENABLEDFalseNormalize stock Django permission display names after migrate
CHASSIS_PERMISSION_NAME_NORMALIZATION_LANGUAGErequired when enabledCurrently 'ru'
CHASSIS_WORKER_PROVIDER'auto'Select a provider by name, 'auto', or 'none' Added in 1.0.19
CHASSIS_WORKER_PROVIDERSDramatiq, CeleryOrdered provider class paths Added in 1.0.19
CELERY_BROKER_URLnoneCelery provider detects the project integration
DRAMATIQ_BROKERnoneDramatiq provider detects the project integration Added in 1.0.19
STORAGES['media']project storageImport/export file storage
CHASSIS_LOGIN_ATTEMPT_LIMITS_ENABLEDTrueApply login-attempt schedule delays
CHASSIS_ADMIN_PATH_PREFIX'/admin/'Prefix watched by session and audit middleware
GEOIP_COUNTRY_DATABASE_PATHunsetGeoLite2 Country MMDB for session/profile country

Optional middleware for Chassis HTML error pages, admin sessions, and the Admin journal:

MIDDLEWARE = [
# ...
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django_chassis.middlewares.UserSessionMiddleware',
'django_chassis.middlewares.AdminAuditMiddleware',
'django_chassis.middlewares.AdminErrorPageMiddleware',
]

See Users and access for GeoIP and login-attempt settings.

Added in 1.0.7

Set CHASSIS_USERS_MODULE_ENABLED = False when the application keeps its own user profiles, Admin sessions, login protection, and audit journal. This is a global opt-out; the per-site include_users_module flag cannot override it.

Admin error-page fallback​

Changed in 1.0.3

When the full AdminSite.each_context() is unavailable, the safe HTML error-page fallback independently calls get_chassis_footer_context() and preserves its developer, product, and version details. An AdminSite without that hook, or an exception raised by the hook, produces an empty footer context without preventing the error page from rendering.

There is no large Chassis settings block. Site and ModelAdmin behaviour is declared in Python on the mixins.

System checks​

ChassisAdminMixin and ChassisAdminSiteMixin register Django system checks for:

  • action permission references
  • export field / filter lookups
  • sidebar model and page references
  • dashboard layout (duplicate slugs, chart cardinality, global alerts)

Run them with the rest of Django's checks:

uv run python manage.py check

Construction-time errors (ImproperlyConfigured) fire when the AdminSite is instantiated: invalid page access contracts, missing view_* permissions on PermissionAdminPage, personal pages in navbar groups.

Supported runtime​

Changed in 1.0.1
  • Python 3.13, 3.14
  • Django 6.0+

Gunicorn​

Added in 1.0.1 Changed in 1.0.20

Chassis ships manage.py run_gunicorn. It starts the project WSGI app with sync workers:

pip install 'django-chassis[gunicorn]'
uv run python manage.py run_gunicorn --port=8000 --workers=2

Gunicorn is an optional extra for WSGI projects. ASGI deployments can use run_uvicorn with the [uvicorn] extra. Importing the command does not load Gunicorn.

The WSGI target comes from --app or Django WSGI_APPLICATION (project.wsgi.application becomes project.wsgi:application). Optional --config points at a Gunicorn Python config.

Uvicorn​

Added in 1.0.20
pip install 'django-chassis[uvicorn]'
uv run python manage.py run_uvicorn --host 0.0.0.0 --port 8000 --workers 2
uv run python manage.py run_uvicorn --workers 1 --reload

The command resolves --app or Django ASGI_APPLICATION. Both project.asgi.application and project.asgi:application are accepted. Command discovery and --help work without Uvicorn installed; execution explains the required extra. Unrelated missing imports keep their original error.

OptionDefaultEnvironment override
--host0.0.0.0—
--port, -p8000PORT
--workers, -w2UVICORN_WORKERS
--log-level, -linfo—
--timeout30 seconds, graceful shutdown—
--timeout-keep-alive5 seconds—
--ws-max-size16777216 bytesUVICORN_WS_MAX_SIZE
--ws-max-queue32 framesUVICORN_WS_MAX_QUEUE

--reload requires one worker. Ports must be 1–65535; workers, timeouts and WebSocket limits must be positive. Explicit CLI arguments override environment variables. Invalid unused environment defaults do not break --help.

CHASSIS_UVICORN_WS_MAX_SIZE and CHASSIS_UVICORN_WS_MAX_QUEUE optionally set the project's WebSocket transport defaults. CLI arguments and environment variables take precedence over these settings; otherwise the standard defaults above apply. These limits bound Uvicorn's transport. Application protocol/authorization limits remain the project's responsibility. See Uvicorn settings.

Optional extra​

pip install 'django-chassis[celery]'
Added in 1.0.19
pip install 'django-chassis[dramatiq]'

Worker selection applies to every Chassis task. See Background tasks for registration and additional providers, and Import/export backends for the single WORKER form choice.

See also​