我正在将应用程序从 Django 1.11.25 (Python 2.6) 升级到 Django 3.1.3 (Python 3.8.5),当我运行时manage.py makemigrations,我收到此消息:
File "/home/eduardo/projdevs/upgrade-intra/corporate/models/section.py", line 9, in <module>
from authentication.models import get_sentinel**
ImportError: cannot import name 'get_sentinel' from partially initialized module 'authentication.models' (most likely due to a circular import) (/home/eduardo/projdevs/upgrade-intra/authentication/models.py)**
Run Code Online (Sandbox Code Playgroud)
我的模型是:
身份验证/models.py
from django.conf import settings
from django.contrib.auth.models import AbstractUser, UserManager
from django.db import models
from django.db.models.signals import post_save
from django.utils import timezone
from corporate.constants import GROUP_SUPPORT
from corporate.models import Phone, Room, Section
from library.exceptions import ErrorMessage
from library.model …Run Code Online (Sandbox Code Playgroud)