I have a directory that looks like this:
I am working in a urls.py file with the path mysite/mysite/urls.py, and I want to import the views.py file from the 'register' folder (with the path /mysite/register/views.py). I tried importing it with this line:
from register import views as v
But I get an error saying that there's no module like that because Python is importing from a register.py file instead of a register-folder. I have tried fixing it by giving the direct path to the right folder, like they showed in this solution, with
# some_file.py
import sys
# insert at 1, 0 is the script path (or '' in REPL)
sys.path.insert(1, '/path/to/application/app/folder')
import file
But I still import the .py-file instead of from the folder. I have tried changing the default path of the whole project, but that only caused more errors. I have had this problem before, because I name classes and functions the same as some built-in function I didn't know about, but this time I cant seem to figure it out.
How can I fix this?