Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am having a hard time trying to run a module from UWSGI. This is part of my deployment code:

# ENVIRONMENT
/usr/bin/pip install virtualenv
mkdir -p /srv/www/test
/usr/local/bin/virtualenv /srv/www/test/venv
source /srv/www/test/venv/bin/activate
/srv/www/test/venv/bin/pip install --force-reinstall -e git+git@github.com:xyz/project.git#egg=project

This is the code in it to run.py in the root of the module

from project import app

def main():
    """docstring for main"""
    app.run(debug=True)

if __name__ == '__main__':
    main()

This is the command I am trying to use to run it:

/usr/local/bin/uwsgi --virtualenv $ENV --module project --chdir $APP --master

This is the message I get after running this command:

uWSGI running as root, you can use --uid/--gid/--chroot options

* WARNING: you are running uWSGI as root !!! (use the --uid flag)
WARNING: you are running uWSGI without its master process manager * your processes number limit is 7890 your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
The -s/--socket option is missing and stdin is not a socket.

The error is that it doesn't seem to run or find my module correctly. Can anyone please tell me how I should be starting UWSGI in order to find my app please?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

You can try --module instead of -w (could do the same thing). Else just make sure you have the names correct; ie. pass wsgi_module_name or wsgi_module_name:application_callable_name

Although, your error message doesn't actually say there is a problem relating to this. Is there another message you haven't quoted?

share|improve this answer
    
Thank you for the reply. My module name is project, so what should the --module or -w flag state? –  Jimmy Feb 5 at 13:39
    
Depends on how you set it up, I guess. My setup personally works by passing the exact phrase: "--module wsgi:application" –  Peter Feb 6 at 1:56

You could just add a sock file to the command line:

/usr/local/bin/uwsgi --virtualenv $ENV --module project --chdir $APP --master -s myapp.sock
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.