user1050619
user1050619

Reputation: 20856

uwsgi http is ambiguous

Im trying to run Django application on uwsgi but get the below error.

uwsgi --http :8000 --home /home/cuser/.virtualenvs/vq --chdir /var/www/sid/sid -w wsgi.py

uwsgi: option '--http' is ambiguous
getopt_long() error

When I change from -http to --socket it works but again it says --home is ambiguous

Upvotes: 19

Views: 14286

Answers (3)

Sushil Deshmukh
Sushil Deshmukh

Reputation: 114

You may want to take into account when using this with distro-supplied packages, is that very probably your distribution has built uWSGI in modular way (every feature is a different plugin that must be loaded).

You have to prepend --plugin python,http to the command, and --plugin python when the HTTP router is removed

Example Appended --plugin python

uwsgi --http :8000 --plugin python --home /home/cuser/.virtualenvs/vq --chdir /var/www/sid/sid -w wsgi.py

Upvotes: 0

oxalorg
oxalorg

Reputation: 2798

This is most likely because you have uwsgi installed from your distributions packaged binaries, which are more minimal in their build and lack some of the plugins.

You can fix this by either pip install uwsgi and replace uwsgi with path/to/uwsgi/binary/installed/using/pip. You can find that using pip show uwsgi.

[Please note: use pip3 if you're using python3]

Another method would be to download the respective http/python3 plugins and running the following command:

uwsgi --plugins http,python --http :8000 --home /home/cuser/.virtualenvs/vq --chdir /var/www/sid/sid -w wsgi.py

Upvotes: 27

GwynBleidD
GwynBleidD

Reputation: 20559

try:

uwsgi --http=:8000 --home=/home/cuser/.virtualenvs/vq --chdir=/var/www/sid/sid -w wsgi.py

For some versions of getopt this should work. If not, try to put your parameters in config file or update getopt library in your system and recompile uWSGI.

Upvotes: -3

Related Questions