I have Apache setup to serve requests for http://www.mysite.com from this directory:
/var/www/html/www.mysite.com
The Django site is in /var/www/html/www.mysite.com/mysite.
I get this error when I make a request for /mysite/app/foo:
(big stack trace) AttributeError: 'module' object has no attribute 'common'
'myapp.common' is the first item listed after all the django apps (eg. 'django.contrib.admin') in INSTALLED_APPS in the settings.py file. If I change the order of modules listed, Django chokes on the first path of one of my applications that it encounters.
The Python import path seems to be correct, since it's finding mysite.settings:
<Location "/mysite/"> SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE mysite.settings PythonOption django.root /mysite PythonDebug On PythonPath "['/var/www/html/www.mysite.com'] + sys.path" </Location>
What could be the problem? It's strange that it's complaining about 'common' when the actual list contains 'mysite.common':
INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'mysite.common', ....
Is this a Django bug or do I have something misconfigured? Perhaps some external dependency needs to be added to the import path? It works OK with the Django development server.