Can't connect to fvldk.sock
ExecStart=/home/fldk/venv/bin/gunicorn --workers 4 -b unix:fldk.sock -m 007 wsgi:app
[Unit]
Description=Gunicorn instance to serve fldk
After=network.target
[Service]
User=fldk
Group=fldk
WorkingDirectory=/home/fldk
Environment="PATH=/home/fldk/venv/bin"
ExecStart=/home/fldk/venv/bin/gunicorn --workers 3 --bind unix:/home/fldk/venv/fldk.sock -m 007 wsgi:app
[Install]
WantedBy=multi-user.target
server {
listen 80;
server_name fldk.ru www.fldk.ru;
location / {
include proxy_params;
proxy_pass http://unix:/home/fldk/venv/fldk.sock;
}
location /static/ {
root /home/fldk/venv;
}
}
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'Bye Bye World!!!'
if __name__ == '__main__':
app.run(host='0.0.0.0')
from mainapp import app
if __name__ == "__main__":
app.run()
Aug 15 15:10:01 elvis systemd[1]: Started Gunicorn instance to serve fldk.
Aug 15 15:10:05 elvis gunicorn[734]: [2019-08-15 15:10:05 +0300] [734] [INFO] Starting gunicorn 19.9.0
Aug 15 15:10:05 elvis gunicorn[734]: [2019-08-15 15:10:05 +0300] [734] [INFO] Listening at: unix:/home/fldk/venv/fldk.sock (734)
Aug 15 15:10:05 elvis gunicorn[734]: [2019-08-15 15:10:05 +0300] [734] [INFO] Using worker: sync
Aug 15 15:10:07 elvis gunicorn[734]: [2019-08-15 15:10:07 +0300] [737] [INFO] Booting worker with pid: 737
Aug 15 15:10:07 elvis gunicorn[734]: [2019-08-15 15:10:07 +0300] [737] [ERROR] Exception in worker process
Aug 15 15:10:07 elvis gunicorn[734]: Traceback (most recent call last):
Aug 15 15:10:07 elvis gunicorn[734]: File "/home/fldk/venv/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
Aug 15 15:10:07 elvis gunicorn[734]: worker.init_process()
Aug 15 15:10:07 elvis gunicorn[734]: File "/home/fldk/venv/lib/python3.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
Aug 15 15:10:07 elvis gunicorn[734]: self.load_wsgi()
Aug 15 15:10:07 elvis gunicorn[734]: File "/home/fldk/venv/lib/python3.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
Aug 15 15:10:07 elvis gunicorn[734]: self.wsgi = self.app.wsgi()
Aug 15 15:10:07 elvis gunicorn[734]: File "/home/fldk/venv/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
Aug 15 15:10:07 elvis gunicorn[734]: self.callable = self.load()
Aug 15 15:10:07 elvis gunicorn[734]: File "/home/fldk/venv/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
Aug 15 15:10:07 elvis gunicorn[734]: return self.load_wsgiapp()
Aug 15 15:10:07 elvis gunicorn[734]: File "/home/fldk/venv/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
Aug 15 15:10:07 elvis gunicorn[734]: return util.import_app(self.app_uri)
Aug 15 15:10:07 elvis gunicorn[734]: File "/home/fldk/venv/lib/python3.7/site-packages/gunicorn/util.py", line 350, in import_app
Aug 15 15:10:07 elvis gunicorn[734]: __import__(module)
Aug 15 15:10:07 elvis gunicorn[734]: ModuleNotFoundError: No module named 'wsgi'
Aug 15 15:10:07 elvis gunicorn[734]: [2019-08-15 15:10:07 +0300] [737] [INFO] Worker exiting (pid: 737)
Aug 15 15:10:07 elvis gunicorn[734]: [2019-08-15 15:10:07 +0300] [734] [INFO] Shutting down: Master
Aug 15 15:10:07 elvis gunicorn[734]: [2019-08-15 15:10:07 +0300] [734] [INFO] Reason: Worker failed to boot.
Aug 15 15:10:07 elvis systemd[1]: fldk.service: Main process exited, code=exited, status=3/NOTIMPLEMENTED
Aug 15 15:10:07 elvis systemd[1]: fldk.service: Unit entered failed state.
Aug 15 15:10:07 elvis systemd[1]: fldk.service: Failed with result 'exit-code'.
messages = ListMessagesMatchingQuery(service,user_id,query)
print(messages)