Skip to main content

a configuration and secret loader for Django

Project description

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. Change from loading one configuration file to one or a list of configuration files, with successive files having precedence over previous ones.

  2. Implement validation functions to provide for customizable data validation and security checks.

  3. Implement environment variable naming scheme to mimic use of dictionaries in other formats.

  4. Add simple command line interface options with argparse and add usage to doumentation.

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.

Author

Jeremy A Gray

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-loader-0.0.4.tar.gz (204.2 kB view hashes)

Uploaded Source

Built Distribution

django_loader-0.0.4-py3-none-any.whl (10.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page