我正在尝试在本地 vista 机器(django+apache+mod-python+postgres)上设置我的开发环境,但由于某种原因我无法加载设置。
一切都可以在内置服务器上运行,但不能在 apache 下运行。
这是我的 httpd.conf
<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE movies.settings
PythonOption django.root /movies
PythonDebug On
PythonPath "['C:/django'] + sys.path"
</Location>
和错误:
ImportError at /
No module named main.urls
Request Method: GET
Request URL: http://localhost/
Exception Type: ImportError
Exception Value:
No module named main.urls
Exception Location:
C:\Python25\lib\site-packages\django\utils\importlib.py in import_module, line 35
Python Executable: C:\Program Files (x86)\Apache Software
Foundation\Apache2.2\bin\httpd.exe
Python Version: 2.5.4
Python Path: ['C:/django', 'C:\\Windows\\system32\\python25.zip',
'C:\\Python25\\Lib', 'C:\\Python25\\DLLs', 'C:\\Python25\\Lib\\lib-tk', 'C:\\Program Files (x86)\\Apache Software Foundation\\Apache2.2', 'C:\\Program Files (x86)\\Apache Software Foundation\\Apache2.2\\bin', 'C:\\Python25', 'C:\\Python25\\lib\\site-packages', 'C:\\Program Files (x86)\\Apache Software Foundation\\Apache2.2/_externals']