python on a cloud server - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html) +--- Thread: python on a cloud server (/thread-15645.html) |
python on a cloud server - IMuriel - Jan-25-2019 Hi im pretty new in python, so im already have a simple app runing locally, and im trying to make it run on digitalocean droplet, with ubuntu 16.04 tls evryting is ok for now i have installed my virtualenv, and nginx, so im trying to use gunicorn, but something might be wrong cause, i cant see the index of my app hope you can helpmeout wsgi.py file import os, sys sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__),'..'))) from flask_blog import app if __name__=="__main__": app.run()when i use gunicorn --bind 0.0.0.0:8000 wsgi:app im getting the following [2019-01-25 19:48:59 +0000] [7179] [INFO] Starting gunicorn 19.9.0 [2019-01-25 19:48:59 +0000] [7179] [INFO] Listening at: http://0.0.0.0:8000 (7179) [2019-01-25 19:48:59 +0000] [7179] [INFO] Using worker: sync [2019-01-25 19:48:59 +0000] [7182] [INFO] Booting worker with pid: 7182and when i try to acces to my app, it just dont change, so appears that unicorn cant reach my app :( my firewall sudo ufw status Status: active To Action From -- ------ ---- 80/tcp ALLOW Anywhere 115/tcp ALLOW Anywhere 21/tcp ALLOW Anywhere 21 ALLOW Anywhere 8000 ALLOW Anywhere 80 ALLOW Anywhere 443 ALLOW Anywhere 80/tcp (v6) ALLOW Anywhere (v6) 115/tcp (v6) ALLOW Anywhere (v6) 21/tcp (v6) ALLOW Anywhere (v6) 21 (v6) ALLOW Anywhere (v6) 8000 (v6) ALLOW Anywhere (v6) 80 (v6) ALLOW Anywhere (v6) 443 (v6) ALLOW Anywhere (v6) RE: python on a cloud server - nilamo - Jan-25-2019 Are you getting errors? Does gunicorn have an access/error log file you can check? RE: python on a cloud server - IMuriel - Jan-25-2019 (Jan-25-2019, 08:02 PM)nilamo Wrote: Are you getting errors? Does gunicorn have an access/error log file you can check?no, im not getting any error im searching on the web to how to get unicorn logfile thanks for answering, let me see if i can get to the log file RE: python on a cloud server - snippsat - Jan-26-2019 I have had several Flask app running on Digitalocean. For setup i have followed this How To Serve Flask Applications with Gunicorn and Nginx on Ubuntu 16.04. Today i would have chosen How To Serve Flask Applications with Gunicorn and Nginx on Ubuntu 18.04. Then use newer Python 3.6 --> that also has virtual environment build in(no install). It also easier if has a GitHub/BitCucket repo with content of Flask app. Then is git clone url_to_repo to get all files to DO.
RE: python on a cloud server - IMuriel - Jan-28-2019 (Jan-26-2019, 12:31 AM)snippsat Wrote: I have had several Flask app running on Digitalocean. thanks it is solved now, i had to destroy my dolpet and install all agian, and now its working |