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

toolbox: Delay import of Preference model

Open jayvdb opened this issue 4 years ago • 2 comments

Early import of Preference causes AppRegistryNotReady

Related to https://github.com/idlesign/django-siteprefs/issues/15

jayvdb avatar May 29 '20 05:05 jayvdb

Coverage Status

Coverage increased (+0.01%) to 95.902% when pulling f34e67b5bf34d3030f020868ec11a47b97dce6f2 on jayvdb:delay-model-import into 9cb3026b94a98299d60ccb61baf567b3d0c64a2f on idlesign:master.

coveralls avatar May 29 '20 05:05 coveralls

The 'cause' for this was the 'need' to import the toolbox into <project>/settings.py, which is very early in the Django startup. That could be avoided in other ways.

However, I think it is still useful for the toolbox to be available very early in the Django startup, even if not everything in the toolbox will work, and especially if it isnt wise to use everything in the toolbox at that stage. It is a toolbox full of goodies, and the engineer should be careful with these tools.

jayvdb avatar May 29 '20 16:05 jayvdb