I want to be able to import things from applications in my project without referring to my project name.
My folder structure is like so; I have a project called djangoproject1, and inside I have a folder called apps, and then I have my individual apps in that folder.
djangoproject1, apps, and all my applications have an empty "__init__.py" file in them.
In my settings.py file I have the following code:
import os
import sys
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(PROJECT_ROOT, "apps"))
I've tried adding my apps to INSTALLED_APPS several ways:
'djangoproject1.apps.app1', 'djangoproject1.apps.app2',
or
'apps.app1', 'apps.app2',
or
'app1', 'app2',
but nothing works. Whenever I try to do:
from app1 import *
I got an unresolved import error. I'm using the latest versions of eclipse and django