Connection refused when tryign to run bottle/flask web framweworks

Νίκος nikos.at.superhost at gmail.com
Mon Aug 20 08:07:59 EDT 2018


Τη Δευτέρα, 20 Αυγούστου 2018 - 7:59:06 π.μ. UTC+3, ο χρήστης dieter έγραψε:
> Νίκος <nikos.at.superhost at gmail.com> writes:
> > i just installed bottle and flask web frameworks in my CentOS environment but i canno get it working even with the simpleste xample. The coonection is refused always.
> 
> "connection refused" is an indication that there is no (running)
> server at the connection port.
> 
> Unlike simple web servers, more complex web frameworks are often not
> started automatically at system startup (as they require complex
> configuration to be meaningfully usable). Likely, this your
> case: you likely need to explicitely start the server component.
> 
> > from bottle import route, run, template
> >
> > @route('/hello/<name>')
> > def index(name):
> >     return template('<b>Hello {{name}}</b>!', name=name)
> >
> > run(host='localhost', port=8080)
> 
> Likely, the code above is supposed to start the server component.
> Ensure, that the start is successful (I typically use "lsof -i"
> to find out whether a server is listening on the expected port).

Iam trying to access the bottle web framework running on my VPS as

http://superhost.gr:8080/hello

i get connection refused

also when i try to view the active socekets with ss tool receive

[root at superhost ~]# ss | grep 8080

nothign as a response

The same stand also if i try to use flask instead of bottle with port 5000

The weird thing is that in my vps command line my hello app is in state of listening

[root at superhost public_html]# python3 app.py 
Bottle v0.12.13 server starting up (using WSGIRefServer())...
Listening on http://localhost:8080/
Hit Ctrl-C to quit.

So, i wonder why the socket with port 8080 aint being displayed.



More information about the Python-list mailing list