I'm running Apache2 on Ubuntu 9 with python 2.6.2 installed. I recieve the next error after i attempt to access a webpage on my small django application:

File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 42, in load_middleware raise exceptions.ImproperlyConfigured('Error posting middleware %s: "%s"' % (mw_module, e))ImproperlyConfigured: Error posting middleware django.middleware.common: "No module named _md5"

Here's my wsgi file:

import os, sys sys.path.append('/etc/apache2/sites-available/') os.environ['DJANGO_Configurations_MODULE'] = 'dynamicuddi.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()

From what I have read I believe it is a python path problem however i haven't seen a real means to fix this which has labored. Any ideas?

Thanks ahead of time.

I do not think this can be a pathing problem, like the one here.

I believe it's locating the django.middleware.common module all right and trying to import it, but that module is leading to an ImportError if you attempt to import "_md5."

  1. You might like to take a look only at that rather extended thread where Graham Dumpleton tries to address this very problem: http://www.mail-archive.com/django-users@googlegroups.com/msg30630.html
  2. Failing that, I would suggest you publish the items in the MIDDLEWARE_CLASSES tuple out of your configurations.py.
  3. Also, what version of Django are you currently running?

Attempt to append to python path you project directory and parent one



sys.path.append('path_to_dynamicuddi_project')
sys.path.append('path_to_dynamicuddi_parent_dir')


Are you able to import haslib? check it out inside a python console

To wrap this up, we wound up re-setting up the OS. I understand this can be a cop out however it fixed the issue for all of us.

Thank you for everyone's help!