Django With Apache And Wsgi Throws Importerror
I'm trying to deploy my Django app to an Apache server with no luck. I succeeded with the WSGI sample application, and tried to host an empty Django project. While it works properl
Solution 1:
It looks like you've been using an old guide for setting up apache2 / wsgi. I'd recommend using the official guide at https://code.google.com/p/modwsgi/wiki/InstallationInstructions
Anyway, your specific problem is that the wsgi application isn't picking up the python path correctly. Change you VirtualHost conf to something like this
<VirtualHost *:80>
ServerName myapp.example.com
ServerAlias myapp
ServerAdmin admin@example.com
DocumentRoot /usr/local/www/django/myapp
WSGIDaemonProcess myapp processes=2 threads=15 display-name=%{GROUP} python-path=/usr/local/www/django/myapp:/path/to/system/python/site-packages
WSGIProcessGroup myapp
WSGIScriptAlias / /usr/local/www/django/myapp/wsgi.py
<Directory /usr/local/www/django/myapp>
<Files wsgi.py>
Order allow,deny
Allow from all
</Files>
</Directory>
</VirtualHost>
Post a Comment for "Django With Apache And Wsgi Throws Importerror"