views:

328

answers:

2

I am trying to setup my development environment on my local vista machine (django+apache+mod-python+postgres) and for some reason I can't load the settings.

Everything works on the built-in server but not under apache.

Here is my 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>

And Error:

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']
A: 

Where does your code for your project reside? The parent of the folder that contains your project should be on the Python path. Assuming main is your project name, and it's in C:\django\projects\main\ you'd need to have c:\django\projects\ on your python path.

Either that, or main.urls should be movies.urls in your settings.py.

Alex Jillard
Where does your code for your project reside? C:/django/movies and it's on the python path
Eeyore
A: 

I know that you asked this question a couple of weeks ago, but if you're still looking for help, you might try ServerFault. If you have success, please report back here!

nixterrimus