diff --git a/examples/pipeline/README.md b/examples/pipeline/README.md index 73bc76d..0888e0b 100644 --- a/examples/pipeline/README.md +++ b/examples/pipeline/README.md @@ -7,3 +7,8 @@ Run ```bash $ python app.py --settings=first_settings,second_settings ``` +or run example with `LazySettings` class + +```bash +$ python app_without_args.py +``` diff --git a/examples/pipeline/app_without_args.py b/examples/pipeline/app_without_args.py new file mode 100644 index 0000000..6534942 --- /dev/null +++ b/examples/pipeline/app_without_args.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +from simple_settings import LazySettings + + +settings = LazySettings( + 'first_settings', 'second_settings' +) + + +print(settings.ONLY_IN_FIRST) +print(settings.ONLY_IN_SECOND) +print(settings.SIMPLE_CONF) diff --git a/examples/simple/app.py b/examples/simple/app.py index 2cd51f4..4c03aa6 100644 --- a/examples/simple/app.py +++ b/examples/simple/app.py @@ -4,5 +4,5 @@ from simple_settings import settings -os.environ.setdefault('settings', 'project_settings') +os.environ.setdefault('SIMPLE_SETTINGS', 'project_settings') print settings.SIMPLE_CONF diff --git a/examples/simple/app_without_env_or_args.py b/examples/simple/app_without_env_or_args.py new file mode 100644 index 0000000..358c33c --- /dev/null +++ b/examples/simple/app_without_env_or_args.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from simple_settings import LazySettings + + +settings = LazySettings('project_settings') +print settings.SIMPLE_CONF