archesproject / arches

Arches is a web platform for creating, managing, & visualizing geospatial data. Arches was inspired by the needs of the Cultural Heritage community, particularly the widespread need of organizations to build & manage cultural heritage inventories
GNU Affero General Public License v3.0
210 stars 139 forks source link

Reraise ImproperlyConfigured in SystemSettings #11118 #11119

Open jacobtylerwalls opened 3 days ago

jacobtylerwalls commented 3 days ago

Types of changes

Description of Change

Protects against silent failure shown in issue

Issues Solved

Closes #11118

Checklist

Ticket Background

Testing considerations

A 'real life' scenario for testing:

Edit the if __name__ ... block of settings.py in core arches to include this (along the lines of #11009):

    import django
    from django.conf import global_settings, settings

    settings_defined_here = {k: v for k, v in locals().items() if k.isupper()}
    settings.configure(default_settings=global_settings, **settings_defined_here)
    django.setup()

Then cd to the directory containing settings.py and attempt to python settings.py. With this change you should get a more appropriate failure instead of a red herring circular import error (emanating because we went to fetch from the database, which doesn't seem correct, and which won't necessarily always fail in future similar situations).

(Then, in #11016, we're going to address the underlying issue with the thumbnail factory by using django.conf settings, not ours)