d1_python icon indicating copy to clipboard operation
d1_python copied to clipboard

Allow overrides of DJANGO_SETTINGS_MODULE in wsgi.py

Open srstsavage opened this issue 1 year ago • 1 comments

Set os.environ.setdefault when setting DJANGO_SETTINGS_MODULE in wsgi.py so that other settings modules can be used by setting DJANGO_SETTINGS_MODULE.

srstsavage avatar Sep 15 '24 06:09 srstsavage

We probably also want the same behavior for test settings here:

https://github.com/DataONEorg/d1_python/blob/master/gmn/src/d1_gmn/tests/gmn_test_case.py#L44

So

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "d1_gmn.settings_test")

instead of

os.environ["DJANGO_SETTINGS_MODULE"] = "d1_gmn.settings_test"

~~but I can make a separate PR for that.~~

(Added to this PR for simplicity).

srstsavage avatar Sep 16 '24 08:09 srstsavage

@rogerdahl Do you think we could get this merged? It's currently blocking our GMN Dockerization effort, and we're hoping not to need to fork the repo for a trivial change.

srstsavage avatar Oct 21 '24 22:10 srstsavage

Thanks, @srstsavage for putting this together. I'll also ask @iannesbitt and @datadavev to see if they can review and merge this if Roger is off on other adventures.

mbjones avatar Oct 24 '24 00:10 mbjones

Gentle bump on this one, is this ready for merge or does it need an additional review?

srstsavage avatar Nov 11 '24 16:11 srstsavage

@iannesbitt or @datadavev can one of you merge this and release a new version of the package to pypi? or let's discuss a path forward on slack.

mbjones avatar Nov 13 '24 06:11 mbjones

Thank you!

srstsavage avatar Nov 22 '24 19:11 srstsavage