There are two databases: default and mart . PostgreSQL db. There are the following lines:
site_user = SiteUser.objects.using('mart').get(id=1) site_user.save(using='default', force_insert=True) site_user = SiteUser.objects.using('default').get(id=1) On the third line, an error occurs that such site_user not found. Although the second line (if you believe the documentation ) should ensure that such site_user created in the default database (otherwise an error will take off).
What could be the problem?