bernardopires / django-tenant-schemas

Tenant support for Django using PostgreSQL schemas.
https://django-tenant-schemas.readthedocs.org/en/latest/
MIT License
1.45k stars 425 forks source link

delaying import of ContentType until django is fully loaded #688

Open landonsilla opened 2 years ago

landonsilla commented 2 years ago

I am attempting to upgrade to Django 3.2.14 and this is now causing a problem.

Screen Shot 2022-08-12 at 6 34 03 PM

It seems that it's trying to load the ContentType model before it's fully loaded. So I'm changing the code here such that the model is loaded as late as possible, after django is fully initialized.

Is this a good idea? Is there a better way?