django.db DEFAULT_DB_ALIAS Example Code

DEFAULT_DB_ALIAS is a constant within the django.db module of the Django project.

Example 1 from AuditLog

Auditlog (project documentation) is a Django app that logs changes to Python objects, similar to the Django admin's logs but with more details and output formats. Auditlog's source code is provided as open source under the MIT license.

AuditLog / src / auditlog / models.py

Example 2 from django-import-export

django-import-export (documentation and PyPI page) is a Django code library for importing and exporting data from the Django Admin. The tool supports many export and import formats such as CSV, JSON and YAML. django-import-export is open source under the BSD 2-Clause "Simplified" License.

django-import-export / import_export / resources.py

Example 3 from django-migration-linter

django-migration-linter (PyPI package information) checks for backwards-incompatible changes in Django ORM schema migrations and warns you about them. The purpose of the project is to save time in older and larger projects by detecting field migrations that will be a problem so you do not run into issues later, and make it easier to enable continuous deployment configurations with database changes. There is a blog post on keeping Django database migrations backward compatible that goes into further detail on the tool.

The django-migration-linter project is open sourced under the Apache 2.0 license.

django-migration-linter / django_migration_linter / migration_linter.py