django-siteprefs
django-siteprefs copied to clipboard
toolbox: Delay import of Preference model
Early import of Preference causes AppRegistryNotReady
Related to https://github.com/idlesign/django-siteprefs/issues/15
Coverage increased (+0.01%) to 95.902% when pulling f34e67b5bf34d3030f020868ec11a47b97dce6f2 on jayvdb:delay-model-import into 9cb3026b94a98299d60ccb61baf567b3d0c64a2f on idlesign:master.
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.