First time here? Check out the FAQ!

Revision history  [back]

I got it:

First I saw I should be executing the uWSGI with the option --wsgi-file and not --module. That got rid of the ImportError but presented a new unable to find "application" callable in file error.

To solve that, I found that the recommended .INI file in previous posts here was this:

 [uwsgi]
socket = /var/uwsgi/askbot.sock
user = www-data
chdir = <django project directory>          #directory that has settings.py file.
logto = /var/log/uwsgi/askbot.err
pidfile =  /var/uwsgi/askbot.pid
pythonpath = <parent of django project directory>
pythonpath = <django project directory>
virtualenv = <path to python virtual environment>
env = DJANGO_SETTINGS_MODULE=<project dir name>.settings
module = django.core.handlers.wsgi:WSGIHandler()
env = LC_ALL=en_US.UTF-8
threads = 1
workers = 4
master = true
max-requests = 1000
harakiri = 120
buffer-size = 24576

But I found in this Stack Overflow answer that the module configuration should be:

module = django.core.wsgi:get_wsgi_application()

It seems this is a change that happened in Django 1.6.

BTW: I'm using Python 2.7 and Django 1.8.19

I got it: it:

First I saw I should be executing the uWSGI with the option --wsgi-file and not --module. That got rid of the ImportError but presented a new unable to find "application" callable in file error.

To solve that, I found that the The recommended .INI file in previous posts here was this:

 [uwsgi]
socket = /var/uwsgi/askbot.sock
user = www-data
chdir = <django project directory>          #directory that has settings.py file.
logto = /var/log/uwsgi/askbot.err
pidfile =  /var/uwsgi/askbot.pid
pythonpath = <parent of django project directory>
pythonpath = <django project directory>
virtualenv = <path to python virtual environment>
env = DJANGO_SETTINGS_MODULE=<project dir name>.settings
module = django.core.handlers.wsgi:WSGIHandler()
env = LC_ALL=en_US.UTF-8
threads = 1
workers = 4
master = true
max-requests = 1000
harakiri = 120
buffer-size = 24576

But I found in this Stack Overflow answer that the module configuration should be:

module = django.core.wsgi:get_wsgi_application()

It seems this is a change that happened in Django 1.6.

BTW: I'm using Python 2.7 and Django 1.8.19