django-configurations icon indicating copy to clipboard operation
django-configurations copied to clipboard

Change configurations.setup() to importer.install()

Open ewelkaw opened this issue 3 years ago • 2 comments

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.

ewelkaw avatar Sep 15 '21 16:09 ewelkaw

Codecov Report

Merging #292 (2c39c41) into master (d89fe5a) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           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.

codecov[bot] avatar Sep 21 '21 20:09 codecov[bot]

@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.

brianhelba avatar Oct 25 '21 16:10 brianhelba