I have a django app. It is quite complicated, I can’t post all the code here, so I have a big picture summary. The setup of the folders in the big picture related to what I’m doing is below. Note that "SomeFolder" is a placeholder name for the actual name. Some folder is a folder containing some python scripts with functions inside of them. It wasn’t installed in the Django app. I dragged and dropped SomeFolder into the backend folder. This is necessary and had to be done. It’s some python stuff unrelated to Django.
Dashboard backend SomeFolder A.py B.py C.py views.py Dashboard frontend manage.py
Inside of views.py at the top, I do
Then, inside of views.py, I have a function that calls some of the functions within the python scripts A.py, B.py, and C.py. This is why I need to import SomeFolder. For example:
def someFunction(): SomeFolder.A_Function_1 SomeFolder.A_Function_2 SomeFolder.B_Function_2 etc.
The issue is, when I run
python manage.py runserver I get a
ModuleNotFoundError: No module named 'SomeFolder' in views.py.
The SomeFolder folder is in the same directory as views.py, so I’m not sure why it’s not being recognized. I’ve seen other similar examples on stackoverflow, but didn’t really understand them or how to fix it so I’m posting my own one here.
Try => from . import SomeFolder