3

On a fairly vanilla FreeBSD system without virtualenv, I'm having trouble getting uwsgi to work with Django.

Attempting to run generates this error:

Traceback (most recent call last):
  File "./myapp/wsgi.py", line 3, in <module>
    from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
unable to load app 0 (mountpoint='') (callable not found or import error)

myapp/wsgi.py is not modified from stock. My ini file:

[uwsgi]
chdir = /usr/local/www
module = myapp.wsgi:application
master = true
processes = 1
socket = /var/run/django.sock
pidfile = /var/run/django.pid
vacuum = true
uid = www
gid = www
enable-threads = true

My research only shows problems related to virtualenv which I'm not using. Any ideas what could be going on? Using Python 3.4 and latest uwsgi from ports. Running from django.core.wsgi import get_wsgi_application in a Python shell yields no errors.

1
  • 1
    I also have the issue on a Ubuntu 14.04 that have been dist-upgraded multiple times. I don't know the cause, but a temporary solution is to manually add the pip directory to the python path. In the ini file, you can add pythonpath = /usr/local/lib/python2.7/dist-packages, or wherever the pip directory is.
    – azmeuk
    Dec 4, 2015 at 8:49

0

You must log in to answer this question.