routers
log_panel.routers
¶
LogsRouter
¶
Route Log model reads/writes to the configured logging database alias.
Add to Django settings::
DATABASE_ROUTERS = ['log_panel.routers.LogsRouter']
The configured logging database is reserved for log_panel models. This
keeps Django and backend-specific system checks from treating unrelated
project apps as migratable on the logging database.
db_for_read(model, **hints)
¶
Direct Log reads to the logging database alias.
db_for_write(model, **hints)
¶
Direct Log writes to the logging database alias.
allow_migrate(db, app_label, model_name=None, **hints)
¶
Allow Log migrations only on the configured logging alias.
Returns False when no alias is configured, preventing accidental
table creation in the default database.