I deployed a flask SocketIO application using uwsgi server in Ubuntu 16.04.I will be getting my original app
instance from a script wsgi.py
from server import app
if __name__ == "__main__":
app.run()
And in a separate virtual environment I installed all the dependencies required for my project and intended to run my application through a configuration file myproject.ini
which will be activated by a service in /etc/systemd/system
Here's the configuaration file myproject.ini
[uwsgi]
module = wsgi:app
master = true
processes = 5
socket = myproject.sock
chmod-socket = 660
vacuum = true
die-on-term = true
And here's the myproject.service
file
[Unit]
Description=uWSGI instance to serve myproject
After=network.target
[Service]
User=user
Group=www-data
WorkingDirectory=/home/user/myproject
Environment="PATH=/home/user/myproject/virtual_frame/bin"
ExecStart=/home/user/myproject/virtual_frame/bin/uwsgi --ini myproject.ini
[Install]
WantedBy=multi-user.target
When I run the application with the default wsgi server of flask then it's working fine
But, when I am trying to run the application with uwsgi server which I configured then I am getting the following error
As gevent doesn't work in python3
, so I am assuming that the uwsgi
server is running the application in python3
enviroment
Therefore, I am interested to know the configuration to force uwsgi to work in python
instead of python3
And here's the status of the project:-