I have a file called views.py that imports a class from another file stored in the same folder. The other file is called models.py and the needed class is called Docgen. I'm using the following code to import.
from .models import Docgen
But I keep getting the following error. ImportError: attempted relative import with no known parent package
No error is shown when I write the line from .models import Docgen but it still won't work for some reason I can't figure out. For some reason the import statement isn't able to locate the file models.py.
I get the same error whenever I try to import a module from .models into views.py in other apps in this project as well. Could it be something in settings that has gotten changed somehow?