0

I am trying to build a webpage using django. Following is my project structure:

Project |- src |- __init__.py |- algorithm |- checker.py |- website |- website |- __init__.py |- websiteapp |- views.py

In my views.py I want to call a function which is inside src/checker.py. To do that I wrote from src.algorithm.checker import *. But this is giving me the following error: from src.algorithm.checker import * ModuleNotFoundError: No module named 'src'. How to import this file in views.py?

faysal
  • 162
  • 2
  • 14
  • 1
    Does this answer your question? [Importing files from different folder](https://stackoverflow.com/questions/4383571/importing-files-from-different-folder) – Joshua Apr 12 '20 at 17:59
  • You probably need to add __init__.py in algorithm and websiteapp folder as well. – Hussain Bohra Apr 12 '20 at 18:03

0 Answers0