Search code examples
djangouwsgi

uwsgi: unrecognized option '--module=MyProject.wsgi:application'


I followed the instructions in https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/uwsgi/ and it was working fine until a few days ago, when I killed the uwsgi processes and tried to restart again. Then it said

uwsgi: unrecognized option '--module=MyProject.wsgi:application'

I've been banging my head trying to solve that problem, ... I've checked my commit history and the script I use to start uwsgi hasn't changed :

#!/bin/bash
# https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/uwsgi/
uwsgi --chdir=/home/MyProject \
    --module=MyProject.wsgi:application \
    --env DJANGO_SETTINGS_MODULE=MyProject.settings \
    --master --pidfile=/tmp/MyProject-masted.pid \
    --socket=/home/MyProject.sock \
    --processes=5 \
    --harakiri=20 \
    --limit-as=128 \
    --max-requests=5000 \
    --vacuum \
    --home=/home/MyProject/env \
    --daemonize=/var/log/uwsgi/MyProject.log

Obviously something must have changed but I cant see what ... I didn't run any update, script didn't change ... PlEaSe HeLp !!!


Solution

  • I ran into this recently when I tried to use the version of uWSGI in the Unbuntu 12.04 repo (1.0.3). It looks likes that version is a bit old. Just use pip to grab it (1.2.5).

    pip install uwsgi