"ImportError: No module named..." when importing my own module

OK so I finally worked it out. As indicated by a few of the answers I needed to add my root folder to the system path.

In the end this is what I did:

import sys
sys.path.append("/home/lucasamos/FYP")

you should try this:

import sys
sys.path.append("../Shares/templates")
import share_data

It adds your templates folder to the list of path python is checking for modules.


Add empty __init__.py on one level with manage.py file.

Such inclusion of __init__.py file indicates to the Python interpreter that the directory should be treated as a Python package.