Importing model in utils.py causes ImproperlyConfigured
Circular import. I've been importing mixin from utils in model and in utils I've been importing model from models that inherited mixin.
I have created a file called utils.py in my Django app, where I keep random classes or functions that do something.
I have run into an issue, where I can't import any model in utils.py file.
I have models called User which inherit from AbstractUser and it's been said to Django by: AUTH_USER_MODEL = 'main.User'
I have also a model called Project.
Whenever I type from main.models import Project or User in utils.py I get django.core.exceptions.ImproperlyConfigured: AUTH_USER_MODEL refers to model 'main.User' that has not been installed
Of course main is in installed apps in settings.
I have solved this before by using get_user_model() for User, but there is no such a function to get a Project.
How to solve this problem? Am I missing something?