Is anyone familiar with configuration on OS X Server?

I had a nice app working, but now it broke, I think it broke when I
upgraded the server from 10.6.2 to 10.6.3.

I know I have two python's installed, apple's and the macports one.
It looks like my mod_python is using the macports one in /opt/local/
Library/Frameworks/Python.framework/Versions/2.6.  That's probably the
same python that my system shell uses:

   192:~ jabraham$ which python
   /opt/local/bin/python
   192:~ jabraham$ ls -l /opt/local/bin/python
   lrwxr-xr-x  1 root  admin  9 Jan 11 08:41 /opt/local/bin/python ->
python2.6
   192:~ jabraham$ ls -l /opt/local/bin/python2.6
   lrwxr-xr-x  1 root  wheel  73 Jan 11 00:32 /opt/local/bin/python2.6
-> /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/
python2.6

and I can import psycopg2 from command line

   192:~ jabraham$ python
   Python 2.6.4 (r264:75706, Jan 11 2010, 00:30:55)
   [GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
   Type "help", "copyright", "credits" or "license" for more
information.
   >>> import psycopg2
   >>>

but when I try to load my django app it can't load psycopg2.  I expect
my site-packages or system path got messed up or something but I'm
really having trouble fixing it, since everything works when I invoke
python manually (i.e. not from apache2/modpython).

I'm using Apple's default apache2 installation, and the full error
message is below my signature.

--
John Abraham

MOD_PYTHON ERROR

ProcessId:      75005
Interpreter:    'admin.hbaspecto.com'

ServerName:     'admin.hbaspecto.com'
DocumentRoot:   '/Website/Django/'

URI:            '/times/timesheets/jea'
Location:       '/times'
Directory:      None
Filename:       '/Website/Django/times/timesheets/jea'
PathInfo:       ''

Phase:          'PythonHandler'
Handler:        'django.core.handlers.modpython'

Traceback (most recent call last):

  File "/Library/Python/2.6/site-packages/mod_python/importer.py",
line 1537, in HandlerDispatch

  File "/Library/Python/2.6/site-packages/mod_python/importer.py",
line 1229, in _process_target

  File "/Library/Python/2.6/site-packages/mod_python/importer.py",
line 1128, in _execute_target

  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/django/core/handlers/modpython.py", line
228, in handler
    return ModPythonHandler()(req)

  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/django/core/handlers/modpython.py", line
201, in __call__
    response = self.get_response(request)

  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/django/core/handlers/base.py", line 73, in
get_response
    response = middleware_method(request)

  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/django/middleware/common.py", line 56, in
process_request
    if (not _is_valid_path(request.path_info) and

  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/django/middleware/common.py", line 142, in
_is_valid_path
    urlresolvers.resolve(path)

  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/django/core/urlresolvers.py", line 303, in
resolve
    return get_resolver(urlconf).resolve(path)

  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/django/core/urlresolvers.py", line 216, in
resolve
    for pattern in self.url_patterns:

  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/django/core/urlresolvers.py", line 245, in
_get_url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns",
self.urlconf_module)

  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/django/core/urlresolvers.py", line 240, in
_get_urlconf_module
    self._urlconf_module = import_module(self.urlconf_name)

  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/django/utils/importlib.py", line 35, in
import_module
    __import__(name)

  File "/Website/Django/times/../times/urls.py", line 5, in <module>
    from django.contrib import admin

  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/django/contrib/admin/__init__.py", line 1,
in <module>
    from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME

  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/django/contrib/admin/helpers.py", line 7,
in <module>
    from django.contrib.admin.util import flatten_fieldsets

  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/django/contrib/admin/util.py", line 2, in
<module>
    from django.db import models

  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/django/db/__init__.py", line 41, in
<module>
    backend = load_backend(settings.DATABASE_ENGINE)

  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/django/db/__init__.py", line 17, in
load_backend
    return import_module('.base', 'django.db.backends.%s' %
backend_name)

  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/django/utils/importlib.py", line 35, in
import_module
    __import__(name)

  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/django/db/backends/postgresql_psycopg2/
base.py", line 22, in <module>
    raise ImproperlyConfigured("Error loading psycopg2 module: %s" %
e)

ImproperlyConfigured: Error loading psycopg2 module: No module named
psycopg2


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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