The command python manage.py makemigrations fails most of time due to the forms.py, in which new models or new fields are referenced at class defin
I had a similar issue with ModelChoiceField in one of my forms. I had to comment out my forms code in order to be able to make migrations.
For me the solution was to move all form imports into their respective view method in views.py.
before:
from .forms import CalculatorForm
def calculator(request):
if request.method != 'POST':
form = CalculatorForm()
# ...
after:
def calculator(request):
from .forms import CalculatorForm
if request.method != 'POST':
form = CalculatorForm()
# ...