Make watchman settings importable
See original GitHub issueThe django-debug-toolbar had a fix a few years ago to make it “import safe” https://github.com/jazzband/django-debug-toolbar/issues/801
This basically changed up the settings so that anything calling getenv wasn’t called directly at the time. This is useful to be able to import the default attributes and configuration from a local settings
For instance this doesn’t seem to be possible in (local) settings.py
collectstatic/django will either exception out about SECRET_KEY or even if this is imported after SECRET_KEY is defined then the locally defined WATCHMAN_CHECKS aren’t set.
from watchman import settings as wm_settings
. . .
WATCHMAN_CHECKS = wm_settings.DEFAULT_CHECKS + ('dashboard.common.watchman.custom_checks.check_crontab', )
I think either the “constant’s” could be moved to a separate constants file or the fix similar to the fix for 801 could be used. The workaround is just to redefine the the full set of DEFAULT_CHECKS locally but those “might” change in a future version and then would automatically update!
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (6 by maintainers)
Top GitHub Comments
I’ve pushed django-watchman 0.16.0 to pypi… hope that helps!
my comment seems to relate to https://github.com/mwarkentin/django-watchman/issues/136