Trying to get django app to work with mod_wsgi on CentOS 5

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-03-12T19:09:54Z Indexed on 2010/03/12 22:37 UTC
Read the original article Hit count: 293

Filed under:
|
|
|

I'm running CentOS 5, and am trying to get a django application working with mod_wsgi. I'm using .wsgi settings I got working on Ubuntu.

Here is the error:

[Thu Mar 04 10:52:15 2010] [error] [client 10.1.0.251] SystemError: dynamic module not initialized properly
[Thu Mar 04 10:52:15 2010] [error] [client 10.1.0.251] mod_wsgi (pid=23630): Target WSGI script '/data/hosting/cubedev/apache/django.wsgi' cannot be loaded as Python module.
[Thu Mar 04 10:52:15 2010] [error] [client 10.1.0.251] mod_wsgi (pid=23630): Exception occurred processing WSGI script '/data/hosting/cubedev/apache/django.wsgi'.
[Thu Mar 04 10:52:15 2010] [error] [client 10.1.0.251] Traceback (most recent call last):
[Thu Mar 04 10:52:15 2010] [error] [client 10.1.0.251]  File "/data/hosting/cubedev/apache/django.wsgi", line 8, in 
[Thu Mar 04 10:52:15 2010] [error] [client 10.1.0.251]    import django.core.handlers.wsgi
[Thu Mar 04 10:52:15 2010] [error] [client 10.1.0.251]  File "/opt/python2.6/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 1, in 
[Thu Mar 04 10:52:15 2010] [error] [client 10.1.0.251]    from threading import Lock
[Thu Mar 04 10:52:15 2010] [error] [client 10.1.0.251]  File "/opt/python2.6/lib/python2.6/threading.py", line 13, in 
[Thu Mar 04 10:52:15 2010] [error] [client 10.1.0.251]    from functools import wraps
[Thu Mar 04 10:52:15 2010] [error] [client 10.1.0.251]  File "/opt/python2.6/lib/python2.6/functools.py", line 10, in 
[Thu Mar 04 10:52:15 2010] [error] [client 10.1.0.251]    from _functools import partial, reduce
[Thu Mar 04 10:52:15 2010] [error] [client 10.1.0.251] SystemError: dynamic module not initialized properly

And here is my .wsgi file

import os
import sys
os.environ['PYTHON_EGG_CACHE'] = '/tmp/django/'
os.environ['DJANGO_SETTINGS_MODULE'] = 'cube.settings'

sys.path.append('/data/hosting/cubedev')

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

© Stack Overflow or respective owner

Related posts about python

Related posts about mod-wsgi