Skip to content

Commit

Permalink
add example of use LazySettings directly
Browse files Browse the repository at this point in the history
  • Loading branch information
drgarcia1986 committed Apr 8, 2016
1 parent f8466a4 commit f6e2dba
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
5 changes: 5 additions & 0 deletions examples/pipeline/README.md
Expand Up @@ -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
```
12 changes: 12 additions & 0 deletions 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)
2 changes: 1 addition & 1 deletion examples/simple/app.py
Expand Up @@ -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
6 changes: 6 additions & 0 deletions 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

0 comments on commit f6e2dba

Please sign in to comment.