Debugging Django App Installation
I've installed a Django application on a new host, but the runserver fails. The first HTTP hit get the error "Import by filename is not supported."
T开发者_运维知识库he final error reads:
File "/usr/lib/pymodules/python2.6/django/utils/importlib.py" in import_module
35. __import__(name)
where the value of name is '/webcode/urls/urls'. This is the value of ROOT_URLCONF.
This does work on the development host. Both boxes are running Django 1.1.1, but the development is running Python 2.5.2, and the new box 2.6.5.
Neither has DJANGO_SETTINGS_MODULE; the settings.py file is in the same directory as manage.py. The new host does have PYTHONPATH set to the directory holding the Django application, and my Django unit tests are passing, though none of these hits the urls.
I've tried switching the value of ROOT_URLCONF to a dotted module reference, but all permutations fail.
Any suggestions for how I can go about debugging this?
ANSWERED: Fixed by changing line to
ROOT_URLCONF='webcode.urls.urls'
I'd previously been setting the value without the quotation marks, as if it were a Python reference rather than a string.
Simple things to check first for Django: file permissions, MEDIA.ROOT, urls.py, ROOT_URLCONF in settings_local.py
精彩评论