Change how required settings are handled #35
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Certain settings are going to be required for the application to run.
Currently
SECRET_KEYis the only one, but the list will most likelygrow over time. The application factory allows for the settings in
settings.pyto be overridden a couple of different ways. Requiredsettings 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.pywill add the key to theconfiguration,
DOES_NOT_EXISTis a value that can be assigned to a keythat is intended to be required.
check_required_settingswill respectboth 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.
toxcan be used to run thetests.
toxrequires asetup.pyin order to install the package intothe virtualenv, so a minimal one is being added for that purpose.
Fixes #32