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'
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With