django-configurations
django-configurations copied to clipboard
Change configurations.setup() to importer.install()
Trying to run example from the docs with Celery results in error message:
django.core.exceptions.ImproperlyConfigured: django-configurations settings importer wasn't correctly installed. Please use one of the starter functions to install it as mentioned in the docs: https://django-configurations.readthedocs.io/
However, changing that to:
from configurations import importer
importer.install()
works fine.
This PR updates the documentation to provide correct command.
Codecov Report
Merging #292 (2c39c41) into master (d89fe5a) will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## master #292 +/- ##
=======================================
Coverage 89.89% 89.89%
=======================================
Files 26 26
Lines 1198 1198
Branches 98 98
=======================================
Hits 1077 1077
Misses 92 92
Partials 29 29
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update d89fe5a...2c39c41. Read the comment docs.
@ewelkaw I'm not able to reproduce this myself.
Internally, the only difference is that configurations.setup()
calls django.setup()
too. However, Celery also calls django.setup()
internally, since doing so is required in order to use Django settings.
If there's a good reason for this change, I'd be happy to consider it, but configurations.setup()
is generally the preferred high-level way to bootstrap things, so I don't think we should change the docs unless it's clearly understood why it's necessary.