J’essaie d’utiliser Django avec Apache, mais lorsque j’essaie de lancer une application WSGI, j’ai l’erreur suivante:
Could not find platform independent libraries Could not find platform dependent libraries Consider setting $PYTHONHOME to [:] ImportError: No module named site
J’ai ceci dans l’inclusion dans mon fichier httpd.conf:
WSGIPythonHome /home/ec2-user/anaconda WSGIScriptAlias / /home/ec2-user/test/wsgi.py WSGIPythonPath /home/ec2-user/test Order deny,allow Allow from all
Et c’est le contenu de mon fichier wsgi.py:
import sys def application(environ, start_response): status = '200 OK' output = 'Hello World!' response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))] start_response(status, response_headers) print >> sys.stderr, 'sys.prefix = %s' % repr(sys.prefix) print >> sys.stderr, 'sys.path = %s' % repr(sys.path) return [output]