Reputation: 953
I'm deploying a (proprietary) Django application (with bad support ;-)). The only thing I need to do is setup a new Django project and implement the app's urls. So my url config is as follows:
1 from django.conf.urls.defaults import patterns, include, url
2
3 urlpatterns = patterns('',
4 url(r'^', include('ap01.urls')),
5 )
The application in question is also added to my INSTALLED_APPS setting.
I can validate (./manage.py validate) and all is good. When running the app I get the following import error:
ImportError at /
No module named ap01.urls
The module is present in the Python Path reported by Django and when manually importing the urls module everything works, ie:
./manage.py shell
__import__('ap01.urls')
I compared setups with the QA and dev servers and everything seems be in place correctly. The only thing that differs is the Python version (2.6 on QA and dev; 2.7 on this new machine).
Upvotes: 2
Views: 514
Reputation: 27796
I would debug this like this:
You need to know where the ImportError gets raised. Then add something like this:
import sys
raise Exception(sys.path)
__init__.py
file? import os, sys; assert False, (os.getuid(), sys.path)
less ...../ap01/...py
Upvotes: 2