简体   繁体   中英

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

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM