All Projects → wemake-services → django-split-settings

wemake-services / django-split-settings

Licence: BSD-3-Clause license
Organize Django settings into multiple files and directories. Easily override and modify settings. Use wildcards and optional settings files.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to django-split-settings

djadmin
Djadmin is a django admin theme
Stars: ✭ 42 (-95.43%)
Mutual labels:  django-settings, django-configuration
Dynaconf
Configuration Management for Python ⚙
Stars: ✭ 2,082 (+126.3%)
Mutual labels:  settings, django-configuration
Qtmvvm
A mvvm oriented library for Qt, to create Projects for Widgets and Quick in parallel
Stars: ✭ 205 (-77.72%)
Mutual labels:  settings
laravel-notification-settings
🔒 A Laravel package that allows you to check the notification settings before send them.
Stars: ✭ 28 (-96.96%)
Mutual labels:  settings
SimpleConfig
No description or website provided.
Stars: ✭ 22 (-97.61%)
Mutual labels:  settings
Laravel App Settings
Store settings in database with a manager UI for your Laravel app
Stars: ✭ 220 (-76.09%)
Mutual labels:  settings
plaster
Application config settings abstraction layer.
Stars: ✭ 19 (-97.93%)
Mutual labels:  settings
Django Settings Export
Access Django settings from templates the right way™
Stars: ✭ 167 (-81.85%)
Mutual labels:  settings
SettingsUI
Windows 11 settings page in WinUI 3 applications ported from Powertoys
Stars: ✭ 95 (-89.67%)
Mutual labels:  settings
OBS Settings Manager
Backup your OBS Studio profiles and manage them in an easy, user friendly way.
Stars: ✭ 20 (-97.83%)
Mutual labels:  settings
android-rxlocationsettings
An easy way to ensure the settings before requesting location using RxJava.
Stars: ✭ 43 (-95.33%)
Mutual labels:  settings
Settings View
🔧 Edit Atom settings
Stars: ✭ 226 (-75.43%)
Mutual labels:  settings
dotfiles
To make life easier when setting up a new computer
Stars: ✭ 31 (-96.63%)
Mutual labels:  settings
Mac
macOS Mojave v. 10.14 setup for developers.
Stars: ✭ 209 (-77.28%)
Mutual labels:  settings
configster
Rust library for parsing configuration files
Stars: ✭ 19 (-97.93%)
Mutual labels:  settings
Django Environ
Django-environ allows you to utilize 12factor inspired environment variables to configure your Django application.
Stars: ✭ 2,425 (+163.59%)
Mutual labels:  settings
Django Dynamic Preferences
Dynamic global and instance settings for your django project
Stars: ✭ 238 (-74.13%)
Mutual labels:  settings
Compose-Settings
Android #JetpackCompose Settings library
Stars: ✭ 188 (-79.57%)
Mutual labels:  settings
nova-dynamic-field
Dynamic field for Laravel Nova
Stars: ✭ 18 (-98.04%)
Mutual labels:  settings
MaterialPreferences
🍉 An Android library that lets you implement MaterialPreferences on Setting UI.
Stars: ✭ 21 (-97.72%)
Mutual labels:  settings

django-split-settings logo


wemake.services test codecov Docs Python Version wemake-python-styleguide

Organize Django settings into multiple files and directories. Easily override and modify settings. Use wildcards in settings file paths and mark settings files as optional.

Read this blog post for more information. Also, check this example project.

Requirements

While this package will most likely work with the most versions of django, we officially support:

  • 2.2
  • 3.2
  • 4.0
  • 4.1

This package has no dependencies itself.

In case you need older python / django versions support, then consider using older versions of django-split-settings.

Installation

pip install django-split-settings

Usage

Replace your existing settings.py with a list of components that make up your Django settings. Preferably create a settings package that contains all the files.

Here's a minimal example:

from split_settings.tools import optional, include

include(
    'components/base.py',
    'components/database.py',
    optional('local_settings.py')
)

In the example, the files base.py and database.py are included in that order from the subdirectory called components/. local_settings.py in the same directory is included if it exists.

Note: The local context is passed on to each file, so each following file can access and modify the settings declared in the previous files.

We also made an in-depth tutorial.

Tips and tricks

You can use wildcards in file paths:

include('components/my_app/*.py')

Note that files are included in the order that glob returns them, probably in the same order as what ls -U would list them. The files are NOT in alphabetical order.

You can modify common settings in environment settings simply importing them

# local_settings.py
from components.base import INSTALLED_APPS

INSTALLED_APPS += (
  'raven.contrib.django.raven_compat',
)

Do you want to contribute?

Read the CONTRIBUTING.md file.

Version history

See CHANGELOG.md file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].