I have a django app that's file tree looks like this:
- app1
- ____init____.py
- functions.py
- management (dir)
- ____init____.py
- excel.py
- commands (dir)
- ____init____.py
- importfromexcel.py
I have my most used methods in functions.py, and I want to use them in excel.py (from app1.functions import method1, method1, method3) , but here comes the issue.
When I run it like python manage.py importfromexcel
, it works. But when I try to run the migrations with python manage.py migrate
it gives import error:
File "PATH_TO_DJANGO\app1\management\excel.py", line 3, in <module>
from app1.functions import method1, method1, method3
ImportError: cannot import name method1
What is wrong with my import? How should I import it if not this way?