Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python on a cloud server
#1
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: 7182
and 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)
Reply
#2
Are you getting errors? Does gunicorn have an access/error log file you can check?
Reply
#3
(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
Reply
#4
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.
Reply
#5
(Jan-26-2019, 12:31 AM)snippsat Wrote: 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.

thanks it is solved now, i had to destroy my dolpet and install all agian, and now its working
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Information Comparing cloud hosts for serverless functions (FaaS) for Python hmartin 0 144 Mar-16-2024, 04:30 PM
Last Post: hmartin

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020