README

django-loader

django-loader: a configuration variable and secrets loader for Django apps.

PyPI Version Documentation Status

What is django-loader?

django-loader is a configuration variable and secrets loader for Django apps. It loads a dictionary of configuration variables into settings.py that consists of default values, values from a configuration file (like .env) and from environment variables. It can load configuration files in TOML, JSON, YAML, and BespON formats. The script interface is able to convert between all available formats.

Roadmap

  1. Implement complete interoperability with TOML, JSON, YAML, and BespON for configuration. (target: 0.5.0)

    • Config().__str__() should output any format * TOML (finished: 0.4.3) * JSON (finished: 0.4.3) * YAML * BespON

    • streamline testing fixture data formats

Installation

Install django-loader with:

pip install django-loader
pip freeze > requirements.txt

or add as a poetry dependency.

If you desire a package locally built with poetry, download the source, change the appropriate lines in pyproject.toml, and rebuild.

Usage

Console:

loader file format

In Python:

>>> import loader
>>> secrets = loader.load_secrets(**{"SECRET_KEY": ""})
>>> SECRET_KEY = secrets["SECRET_KEY"]

See the source and documentation for more information.

Configuration

There are no configuration files or options; all configurable options will be accessible as function parameters or options in the command line interface.