Skip to content

Conversation

@dirn
Copy link
Contributor

@dirn dirn commented Feb 26, 2014

Certain settings are going to be required for the application to run.
Currently SECRET_KEY is the only one, but the list will most likely
grow over time. The application factory allows for the settings in
settings.py to be overridden a couple of different ways. Required
settings should be checked after all of the overrides have been
processed.

This is being implemented in the form of a helper function that checks
for the required keys. Because settings.py will add the key to the
configuration, DOES_NOT_EXIST is a value that can be assigned to a key
that is intended to be required. check_required_settings will respect
both the absence of the key and the value DOES_NOT_EXIST.

Along with this change comes some tests. These two tests are the
groundwork for the eventual suite of tests. tox can be used to run the
tests. tox requires a setup.py in order to install the package into
the virtualenv, so a minimal one is being added for that purpose.

Fixes #32

Certain settings are going to be required for the application to run.
Currently `SECRET_KEY` is the only one, but the list will most likely
grow over time. The application factory allows for the settings in
`settings.py` to be overridden a couple of different ways. Required
settings should be checked after all of the overrides have been
processed.

This is being implemented in the form of a helper function that checks
for the required keys. Because `settings.py` will add the key to the
configuration, `DOES_NOT_EXIST` is a value that can be assigned to a key
that is intended to be required. `check_required_settings` will respect
both the absence of the key and the value `DOES_NOT_EXIST`.

Along with this change comes some tests. These two tests are the
groundwork for the eventual suite of tests. `tox` can be used to run the
tests. `tox` requires a `setup.py` in order to install the package into
the virtualenv, so a minimal one is being added for that purpose.

Fixes #32
jonafato added a commit that referenced this pull request Feb 26, 2014
Change how required settings are handled
@jonafato jonafato merged commit b558a4a into master Feb 26, 2014
@dirn dirn deleted the validate-after-all-settings branch February 26, 2014 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validate required settings after loading all settings

3 participants