[Django]-Django circular import and model issue

9👍

Import the Address model with django’s apps.get_model. https://docs.djangoproject.com/en/1.11/ref/applications/#django.apps.apps.get_model.

In your processor app models.py replace

from address.models import Address
...defining clasess
class Displayble(models.Model):
# It has no DB fields

With

from django.apps import apps
Address = apps.get_model(app_label='address', model_name='Address')
....go ahead and use Address as though imported
class Displayable(models.Model):
...

Leave a comment