summaryrefslogtreecommitdiff
path: root/devel/py-python-decouple/pkg-descr
blob: 0656385bc0564d4bbe60190dea27c92232bd0a3a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Decouple helps you to organize your settings so that you can change parameters
without having to redeploy your app.

It also makes it easy for you to:

* store parameters in ini or .env files;
* define comprehensive default values;
* properly convert values to the correct data type;
* have only one configuration module to rule all your instances.
* It was originally designed for Django, but became an independent generic too
  for separating settings from code.

Import the config object:

from decouple import config

Retrieve the configuration parameters:

SECRET_KEY = config('SECRET_KEY')
DEBUG = config('DEBUG', default=False, cast=bool)
EMAIL_HOST = config('EMAIL_HOST', default='localhost')
EMAIL_PORT = config('EMAIL_PORT', default=25, cast=int)

WWW: https://github.com/henriquebastos/python-decouple/