I have a django 1.9 application using DRF with the following folder structure
- api/
- api/models.py
- api/serializers.py
- api/views.py
- manage.py
In serializers.py I have an import:
from api.models import Model1, Model2, ...
In views.py I have these imports:
from api.serializers import NotificationSerializer
from api.models import Model1, Model2, ...
Everything works fine until now. But after adding
from api.serializers import NotificationSerializer
in models.py, django starts complaining when I start the dev server:
File ".../api/serializers.py", line 3, in <module>
from api.models import Model1, Model2,...
ImportError: cannot import name Model1
I know that there must be a problem with the python import paths, but I can't figure it out.