django-split-settings helps organize Django settings into multiple files and directories, allowing for easier overriding and modification. It supports wildcards, optional settings files, and includes/merges settings from various sources. The current version is 1.3.2, with a release cadence that addresses bugfixes and adds support for newer Python and Django versions.
pip install django-split-settingsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates a typical setup for django-split-settings. In your `settings/__init__.py` file (or directly in your main `settings.py`), you import `include` and `optional`. You then use `include` to pull in other settings files, often starting with a `base.py` for common configurations, followed by environment-specific or local override files. The `optional()` wrapper ensures that your application doesn't crash if an included file (e.g., a developer's `local.py`) doesn't exist.
Replace `include('file.py', globals=globals())` with `include('file.py', scope=globals())`. If you were passing other unsupported keyword arguments, remove them as they were not functional prior to 1.3.0 anyway.Upgrade your Python environment to 3.9, 3.10, 3.11, or 3.12.
Always wrap paths to potentially missing settings files with `optional()`, for example: `include(optional('local.py'))`.Upgrade your Django and Python versions to modern supported releases, or pin `django-split-settings<1.0.0`.
The `include` signature changed. Replace `globals=globals()` with `scope=globals()`. For example, `include('file.py', scope=globals())`.Install the package using `pip install django-split-settings`. Ensure your virtual environment is activated if applicable.
Wrap the path of the potentially missing file with `optional()`: `include(optional('settings/local.py'))`.No dependency data recorded yet.