[Fixed]-Django and uwsgi configuration issues

1👍

uWSGI is a binary application linking to a specific python library (like apache+mod_wsgi). Running it in a virtualenv only changes its view of python modules, not the python library it is linked with. As you are using the ubuntu package you only need to install the plugin for python 3 (and load it with plugin = python3). Otherwise activate your virtualenv and pip install uwsgi to have a monolithic version linked with the virtualenv specific python library.

0👍

I had used this configuration – everything was fine.

[uwsgi]
chdir=/var/www/prj_name
home=/home/uwsgi/.virtualenvs/prj_name/
pythonpath=/var/www/prj_name
env=DJANGO_SETTINGS_MODULE=prj_name.settings
module=prj_name.wsgi:application
socket=127.0.0.1:3001
master=True
vacuum=True
max-requests=5000
threads = 20
enable-threads = True
buffer-size = 8192
logger = file:/var/logs/prj_name/uwsgi.log

By the way, take a look on virtualenvwrapper and gunicorn. This packages can help you in everyday development a lot.

Leave a comment