djongo
djongo copied to clipboard
ModuleNotFoundError: No module named 'django.db.models.fields.mixins'
One line description of the issue
python3.6 with django 1.11.12 mongodb 3.6.4 python manage.py makemigrations
Python script
<copy and paste code here>
Traceback
@hellonts After recent updates Djongo only supports Django 2.0 onwards.
Did you install djongo from pip?
yes, with django 2.0 work is normal @arindammanidas @nesdis
I am still getting from django.db.models.loading import cache as model_cache
ModuleNotFoundError: No module named 'django.db.models.loading' in Django 3.2.10
This is my Model:
class User(AbstractBaseUser, PermissionsMixin):
from django.db.models.loading import cache as model_cache
if not model_cache.loaded:
model_cache._populate()
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
email_address = models.EmailField(max_length=255, unique=True)
name = models.CharField(max_length=255)
organization_id = models.ForeignKey('organization.Organization', blank=True, null=True,
on_delete=models.CASCADE, related_name='organization_id')
practitioner_id = models.ForeignKey('practitioner.Practitioner', blank=True, null=True,
on_delete=models.CASCADE, related_name='practitioner_id')
supplier_id = models.ForeignKey('supplier.Supplier', blank=True, null=True,
on_delete=models.CASCADE, related_name='supplier_id')
I also tried this:
class User(AbstractBaseUser, PermissionsMixin):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
email_address = models.EmailField(max_length=255, unique=True)
name = models.CharField(max_length=255)
organization_id = models.ForeignKey('organization.Organization', blank=True, null=True,
on_delete=models.CASCADE, related_name='organization_id')
practitioner_id = models.ForeignKey('practitioner.Practitioner', blank=True, null=True,
on_delete=models.CASCADE, related_name='practitioner_id')
supplier_id = models.ForeignKey('supplier.Supplier', blank=True, null=True,
on_delete=models.CASCADE, related_name='supplier_id')
it give me error:
TypeError: isinstance() arg 2 must be a type or tuple of types
What wrong I am doing here? Any help is appriciated.