OperationCode/back-end

View on GitHub
src/settings/__init__.py

Summary

Maintainability
A
0 mins
Test Coverage
"""
This is a django-split-settings main file.
For more information read this:
https://github.com/sobolevn/django-split-settings
To change settings file:
`DJANGO_ENV=production python manage.py runserver`
"""
from os import environ

from split_settings.tools import include, optional

# Managing environment via DJANGO_ENV variable:
environ.setdefault("DJANGO_ENV", "development")
ENV = environ["DJANGO_ENV"]

# Include settings:
include(
    "components/*.py",
    # Select the right env:
    f"environments/{ENV}.py",
    # Optionally override some settings:
    optional("environments/local.py"),
)