Target Wsgi Script Cannot Be Loaded as Python Module

Django Apache: Target WSGI Script Cannot Be Loaded as Python Module

You should add your project path (/home/sharan/myproject/proj_VivRx1) to python-path parameter of WSGIDaemonProcess Apache directive.

Target WSGI script cannot be loaded as a python module and ImportError: No module named 'django'

I'm cleared the issue by folling link https://github.com/GrahamDumpleton/mod_wsgi/issues/378

Target WSGI script cannot be loaded as Python module + ImportError: No module named

Instead of:

WSGIDaemonProcess itemcatalog python-path=/var/www/itemcatalog:/var/www/itemcatalog/venv/lib/python2.7/site-packages

use:

WSGIDaemonProcess itemcatalog python-path=/var/www \
python-home=/var/www/itemcatalog/venv

The Python path must be the parent directory of the package, not the package directory itself.

Instead of using python-path to setup virtual environment, use python-home as explained in official documentation:

  • http://modwsgi.readthedocs.io/en/develop/user-guides/virtual-environments.html


Related Topics



Leave a reply



Submit