Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bottle with Gunicorn

What is the difference between running bottle script like this

from bottle import route, run

@route('/')
def index():
    return 'Hello!'

run(server='gunicorn', host='0.0.0.0', port=8080)

with command python app.py and this

from bottle import route, default_app

@route('/')
def index():
    return 'Hello!'

app = default_app()

with command gunicorn app:app --bind='0.0.0.0:8080'

like image 374
Most Wanted Avatar asked Oct 21 '22 00:10

Most Wanted


1 Answers

Essentially nothing.

From the bottle source code for the GunicornServer here you can see that a basic application is loaded and run with your argument. From the gunicorn source code this is what is invoked by the gunicorn command according to setup.py. The only difference is the WSGIApplication class is used. Well, default_proc_name is either 'app:app' or 'gunicorn' depending on which one you invoked with. None of the other parameters matter in this simple case.

like image 148
dreamriver Avatar answered Oct 30 '22 01:10

dreamriver