2👍
✅
You have a circular import issue. Your models file has a views import, then your views import has a model import. There are a number of ways to solve this, we’d have to see your models and views source.
0👍
I know this thread is really old, but just in case it might help someone else, I wanted to share how I fixed this when I had this same problem. As @professorDante has said it is a circular import issue, and so I was able to simply create another file, which I called shared_functions.py
and move the function, test()
, into that file. Then I could import the function in to both of my files that previously had the circular import issue as:
from .shared_functions import test
- [Answered ]-Deleting multiple rows using checkbox in Django frontend
- [Answered ]-403 template displaying instead of 404
- [Answered ]-403 Forbidden and request.method showing GET in django
- [Answered ]-How do i include my footer.html in my base.html
Source:stackexchange.com