sebpiq
sebpiq

Reputation: 7802

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 !!!

Upvotes: 16

Views: 13920

Answers (3)

Raunit Verma
Raunit Verma

Reputation: 196

Try this

uwsgi --socket /run/uwsgi/mysite.sock --chdir /home/ubuntu/mysite/ --plugin The_OJ.wsgi --chmod-socket=666

Upvotes: 0

SingleNegationElimination
SingleNegationElimination

Reputation: 156158

You probably need to add the --plugins option to your command line to use the system installed uwsgi. On Fedora 17, at least, this is neccesary for me:

$ uwsgi --http 127.0.0.1:8000 --module=wsgiref.simple_server:demo_app
uwsgi: unrecognized option '--module=wsgiref.simple_server:demo_app'
getopt_long() error
$

but this works:

$ uwsgi --http 127.0.0.1:8000 --plugins python --module=wsgiref.simple_server:demo_app
*** Starting uWSGI 1.2.4 (64bit) on [Thu Aug 30 14:09:57 2012] ***
[.. snip]

Upvotes: 41

AndrewJesaitis
AndrewJesaitis

Reputation: 482

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

Upvotes: 15

Related Questions