Note that there are some explanatory texts on larger screens.

plurals
  1. POImportError: No module named django.core.handlers.wsgi in install django mod_wsgi config on apache
    primarykey
    data
    text
    <p>I tried to install django to work with apache and mod_wsgi but get this error:</p> <pre><code>ImportError: No module named django.core.handlers.wsgi, </code></pre> <p>I'v read that it may be user error... </p> <p>On the console (ssh), with root access, I don't have any problems accessing django.core.handlers.wsgi , but when apache asks to access it, it can't</p> <p>My django.wsgi:</p> <pre><code>import os import sys sys.path.append('my/rep/parents/of/my/project') sys.path.append('/usr/lib/python2.4/site-packages/django') os.environ['DJANGO_SETTINGS_MODULE'] = 'montest.settings' os.environ['PYTHON_EGG_CACHE'] = '/tmp' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() </code></pre> <p>My vhost.conf:</p> <pre><code>Alias /media/ my/rep/parents/of/my/projet/montest/media/ &lt;Directory my/rep/parents/of/my/projet/montest/media&gt; Order deny,allow Allow from all &lt;/Directory&gt; WSGIScriptAlias /montest my/rep/parents/of/my/projet/django.wsgi &lt;Directory my/rep/parents/of/my/projet&gt; Order deny,allow Allow from all &lt;/Directory&gt; </code></pre> <p>EDIT :</p> <p>Ok my result for ldd mod_wsgi.so </p> <pre><code>linux-gate.so.1 =&gt; (0x0013c000) libpython2.6.so.1.0 =&gt; /usr/lib/libpython2.6.so.1.0 (0x00663000) libpthread.so.0 =&gt; /lib/libpthread.so.0 (0x00bff000) libdl.so.2 =&gt; /lib/libdl.so.2 (0x0023b000) libutil.so.1 =&gt; /lib/libutil.so.1 (0x00420000) libm.so.6 =&gt; /lib/libm.so.6 (0x00110000) libc.so.6 =&gt; /lib/libc.so.6 (0x00240000) /lib/ld-linux.so.2 (0x0059f000) </code></pre> <p>So i decide to test my mod_wsgi install with the test.wsgi</p> <p>test.wsgi</p> <pre><code>def application(environ, start_response): status = '200 OK' output = 'Hello world, I am a wsgi app!' response_headers = [('Content-Type', 'text/plain'), ('Content-Length', str(len(output)))] start_response(status, response_headers) return [output] </code></pre> <p>my vhost.conf:</p> <pre><code>WSGIScriptAlias /test /var/www/vhosts/mydomain.fr/subdomains/django/httpdocs/test.wsgi &lt;Directory /var/www/vhosts/mydomain.fr/subdomains/django/httpdocs&gt; Order allow,deny Allow from all Options +ExecCGI &lt;/Directory&gt; </code></pre> <p>It now works... next I will try my django.wsgi config</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload