Skip to content

Commit

Permalink
Merge 640898f into 161d101
Browse files Browse the repository at this point in the history
  • Loading branch information
renzon committed Oct 23, 2017
2 parents 161d101 + 640898f commit 071e623
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -61,9 +61,14 @@ pip install dynaconf
```

> NOTE: this project officially supports and encourages only Python 3+. Currently this is working well and tests are passing on any Python version above 2.7 but at any moment we can drop python2.x support if needed.
# settings module

If you have a settings.py, settings.yml or a settings.yaml in project's root, dynaconf will load it for you.
Otherwise see next section.

# define your settings module


```bash
export DYNACONF_SETTINGS=myproject.settings
or
Expand Down
10 changes: 8 additions & 2 deletions dynaconf/default_settings.py
@@ -1,9 +1,15 @@
# default proj root
# pragma: no cover
from os import path

PROJECT_ROOT = "."

# Default settings file
SETTINGS_MODULE_FOR_DYNACONF = 'settings.py'
for _config_file in ('settings.py', 'settings.yml', 'settings.yaml'):
if path.exists(path.join(PROJECT_ROOT, _config_file)):
SETTINGS_MODULE_FOR_DYNACONF = _config_file
break
else:
SETTINGS_MODULE_FOR_DYNACONF = 'settings.py'

# Namespace for envvars
DYNACONF_NAMESPACE = 'DYNACONF'
Expand Down
2 changes: 1 addition & 1 deletion dynaconf/loaders/yaml_loader.py
Expand Up @@ -64,7 +64,7 @@ def load(obj, namespace=None, silent=True, key=None, filename=None):
data = {}
try:
data = yaml_data[namespace.lower()]
except KeyError as e:
except KeyError:
if silent:
if hasattr(obj, 'logger'):
obj.logger.debug(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -31,7 +31,7 @@ def parse_md_to_rst(file):

setup(
name='dynaconf',
version="0.5.2",
version="0.6",
url='https://github.com/rochacbruno/dynaconf',
license='MIT',
author="Bruno Rocha",
Expand Down

0 comments on commit 071e623

Please sign in to comment.