I keep tossing the best saying a module is not installed that's. Any help could be much appreciated.
I have looked around and it is been recommended this error might be solved by stretching the sys road to range from the application directory. Something I am confident is taken proper care of through the sys.path directive within the WSGI file:
import os, sys
sys.path.append('/home/osqa')
sys.path.append('/home/osqa/trunk')
os.environ['DJANGO_SETTINGS_MODULE'] = 'trunk.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
The mistake output appears like this:
[info] mod_wsgi (pid=15737): Attach interpreter ''.
[info] mod_wsgi (pid=15737): Create interpreter 'trunk|'.
[info] [client 172.31.0.6] mod_wsgi (pid=15737, process='OSQA', application='trunk|'):
Loading WSGI script '/home/osqa/trunk/apache/django.wsgi'.
[error] [client 172.31.0.6] mod_wsgi (pid=15737): Exception occurred processing WSGI
script '/home/osqa/trunk/apache/django.wsgi'.
[error] [client 172.31.0.6] Traceback (most recent call last):
[error] [client 172.31.0.6] File "/usr/lib/python2.6/site-
packages/django/core/handlers/wsgi.py", line 230, in __call__
[error] [client 172.31.0.6] self.load_middleware()
[error] [client 172.31.0.6] File "/usr/lib/python2.6/site-
packages/django/core/handlers/base.py", line 42, in load_middleware
[error] [client 172.31.0.6] raise exceptions.ImproperlyConfigured('Error importing
middleware %s: "%s"' % (mw_module, e))
[error] [client 172.31.0.6] ImproperlyConfigured: Error importing middleware
forum.middleware.extended_user: "No module named markdown"
And also the Apache Config appears like this:
WSGISocketPrefix run/wsgi
<VirtualHost *:80>
ServerAdmin xxx@xxx.com
DocumentRoot /home/osqa/trunk
ServerName trunk
CustomLog logs/osqa.access.log common
ErrorLog logs/osqa.error.log
WSGIScriptAlias / /home/osqa/trunk/apache/django.wsgi
<Directory> /home/osqa/trunk/apache>
Order deny,allow
Allow from all
</Directory>
WSGIDaemonProcess OSQA
WSGIProcessGroup OSQA
Alias /m/ /home/osqa/trunk/forum/skins/
<Directory /home/osqa/trunk/forum/skins>
Order deny,allow
Allow from all
</Directory>
Alias /upfiles/ /home/osqa/trunk/forum/upfiles/
<Directory /home/osqa/trunk/forum/upfiles>
Order deny,allow
Allow from all
</Directory></VirtualHost>
forum.middleware.extended_user appears like this: from django.contrib.auth.middleware import AuthenticationMiddleware from django.contrib.auth import logoutfrom forum.models.user import AnonymousUser from forum.sights.auth import forward_suspended_userimport logging
class ExtendedUser(AuthenticationMiddleware):
def process_request(self, request):
super(ExtendedUser, self).process_request(request)
if request.user.is_authenticated():
try:
request.user = request.user.user
if request.user.is_suspended():
user = request.user
logout(request)
return forward_suspended_user(request, user)
return None
except Exception, e:
import traceback
logging.error("Unable to convert auth_user %s to forum_user: \n%s" % ( request.user.id, traceback.format_exc()
))
request.user = AnonymousUser()
return None
Are you able to publish this middleware that's tossing the exception therefore we can easily see precisely what it's attempting to import?
Seems like it's posting markdown, and markdown is not in your path. Normally, this is set up in your site-packages
directory and less inside your project.
try pip install markdown
Update: you stated it's certainly installed. Where's markdown installed?