I am trying to set up a simple test website in the Apache Server that
comes with OSX 10.5.8 and continuously ran into errors that
complainted about not able to import something in pscycopg2. The site
works if I ran with the django development server. When I port to
Apache, it did not work. Can someone tell me what I am missing?

--------

The set up is as followed:
Python
- version: 2.6
- installed location: /Library/Frameworks/Python.framework/Versions/
2.6/

Psycopg2
- version: 2.0.12
- installed location: /Library/Frameworks/Python.framework/Versions/
2.6/lib/python2.6/site-packages/psycopg2

Other installed components:
mod_wsgi-3.0c4

--------

My test site stuff is in "/Users/myname/mysite3"

Inside "/Users/myname/mysite3", the following files and directories
exist:
- __init__.py
- manage.py
- settings.py
- urls.py
- apache (folder)
      - myapp.wsgi
- blog (django app folder)
      - __init__.py
      - models.py (empty)
      - views.py
- django (folder, symbolic link to the django directory)

------

The content of /mysite3/settings.py is as followed:
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'djangodb'
DATABASE_USER = 'postgres'
DATABASE_PASSWORD = 'myname'
DATABASE_HOST = 'localhost'
DATABASE_PORT = '5432'

ROOT_URLCONF = 'mysite3.urls'

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'mysite3.blog',
)

The rest of the settings are the default

--------

The url address www.test-mysite.com is bind to /mysite3/apache/
myapp.wsgi with the following settings:

In "/etc/apache2/http.conf":
# Virtual hosts
Include /private/etc/apache2/extra/httpd-vhosts.conf

In "/private/etc/apache2/extra/httpd-vhosts.conf":
<VirtualHost 127.0.0.1:80>
    ServerName www.test-mysite.com
    ServerAdmin webmas...@test-mysite.com
    DocumentRoot "/Users/myname/wsgi/documents"
    ServerAlias test-mysite.com
    ErrorLog "/private/var/log/apache2/mysite.com-error_log"
    CustomLog "/private/var/log/apache2/mysite.com-access_log" common

    <Directory /Users/myname/wsgi/documents>
      Order allow,deny
      Allow from all
    </Directory>

    <Directory /Users/myname/mysite3/apache>
        Order deny,allow
        Allow from all
    </Directory>

    WSGIScriptAlias / /Users/myname/mysite3/apache/myapp.wsgi

</VirtualHost>

--------

The content of /mysite3/apache/myapp.wsgi is as followed:

import os, sys
sys.path.append('/Users/simonlee')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite3.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

-------

When I entered www.test-mysite.com into the browser, it gave me the
following error message:

Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request....

The following error was logged in my error log file:

[Wed Aug 19 11:00:26 2009] [error] [client 127.0.0.1] mod_wsgi
(pid=120): Exception occurred processing WSGI script '/Users/myname/
mysite3/apache/myapp.wsgi'.
[Wed Aug 19 11:00:26 2009] [error] [client 127.0.0.1] Traceback (most
recent call last):
[Wed Aug 19 11:00:26 2009] [error] [client 127.0.0.1]   File "/Users/
myname/mysite3/django/core/handlers/wsgi.py", line 239, in __call__
[Wed Aug 19 11:00:26 2009] [error] [client 127.0.0.1]   File "/Users/
myname/mysite3/django/core/handlers/base.py", line 67, in get_response
[Wed Aug 19 11:00:26 2009] [error] [client 127.0.0.1]   File "/Users/
myname/mysite3/django/contrib/sessions/middleware.py", line 9, in
process_request
[Wed Aug 19 11:00:26 2009] [error] [client 127.0.0.1] ImportError: No
module named db

----------

I tried everything that I found on the web but nothing seems to work.
Any suggestion would be much appreciated.

Simon

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to