You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It assumes that if any Site objects exist, that a site matching settings.SITE_ID will exist. That's not always true. We have two projects which share the same database, and they have different values for settings.SITE_ID.
When I migrate the first project, all good. When I migrate the second project, there is a Site object, so this migration doesn't bother creating a new one to match settings.SITE_ID, and then I get django.contrib.sites.models.DoesNotExist: Site matching query does not exist.
I think it could be fixed by changing the code like this:
It assumes that if any
Site
objects exist, that a site matchingsettings.SITE_ID
will exist. That's not always true. We have two projects which share the same database, and they have different values forsettings.SITE_ID
.When I migrate the first project, all good. When I migrate the second project, there is a
Site
object, so this migration doesn't bother creating a new one to matchsettings.SITE_ID
, and then I getdjango.contrib.sites.models.DoesNotExist: Site matching query does not exist.
I think it could be fixed by changing the code like this:
This also applies to django-fluent/django-fluent-contents#55
Any objections?
The text was updated successfully, but these errors were encountered: