devel/py-python-decouple: Add new port: Separation of settings from code

Decouple helps you to organize your settings so that you can change
parameters without having to redeploy your app.

re: https://github.com/henriquebastos/python-decouple/
This commit is contained in:
Dan Langille 2022-01-06 15:57:05 +00:00
parent 494cfc7c54
commit eb231fa7d7
4 changed files with 45 additions and 0 deletions

View file

@ -5112,6 +5112,7 @@
SUBDIR += py-python-bugzilla SUBDIR += py-python-bugzilla
SUBDIR += py-python-dbusmock SUBDIR += py-python-dbusmock
SUBDIR += py-python-distutils-extra SUBDIR += py-python-distutils-extra
SUBDIR += py-python-decouple
SUBDIR += py-python-dtrace SUBDIR += py-python-dtrace
SUBDIR += py-python-easyconfig SUBDIR += py-python-easyconfig
SUBDIR += py-python-editor SUBDIR += py-python-editor

View file

@ -0,0 +1,17 @@
PORTNAME= python-decouple
DISTVERSION= 3.5
CATEGORIES= devel python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= dvl@FreeBSD.org
COMMENT= Strict separation of settings from code
LICENSE= MIT
USES= python:3.6+
USE_PYTHON= distutils autoplist
NO_ARCH= yes
.include <bsd.port.mk>

View file

@ -0,0 +1,3 @@
TIMESTAMP = 1641484322
SHA256 (python-decouple-3.5.tar.gz) = 68e4b3fcc97e24bc90eecc514852d0bf970f4ff031f5f7a6728ddafa9afefcaf
SIZE (python-decouple-3.5.tar.gz) = 11655

View file

@ -0,0 +1,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/