bottlepy / bottle

bottle.py is a fast and simple micro-framework for python web-applications.
http://bottlepy.org/
MIT License
8.39k stars 1.46k forks source link

Bottle's default listen address is printed even when using a different backend #1327

Closed stigok closed 3 years ago

stigok commented 3 years ago

When using e.g. gunicorn, Bottle's default listen address is printed

Listening on http://127.0.0.1:8080/
Hit Ctrl-C to quit.

Then comes gunicorn and prints the actual configuration

[2021-01-20 17:40:13 +0000] [7] [INFO] Starting gunicorn 20.0.4
[2021-01-20 17:40:13 +0000] [7] [DEBUG] Arbiter booted
[2021-01-20 17:40:13 +0000] [7] [INFO] Listening at: http://0.0.0.0:5000 (7)

https://github.com/bottlepy/bottle/blob/f9b1849db4dd724e36a93a1032be592193fba581/bottle.py#L3721-L3722

Using setup

    server.app.run(
        server="gunicorn",
        worker_class="sync",
        workers=5,
        preload_app=True,
        accesslog="-",
        errorlog="-",
        loglevel="debug",
        capture_output=True,
        keepalive=60,
        bind=f"0.0.0.0:5000",
        debug=True,
    )
stigok commented 3 years ago

it works properly when I use host and port kwargs instead of bind. I should have read the code I posted more thoroughly

    server.app.run(
        host="0.0.0.0"
        port="5000",
        server="gunicorn",
        worker_class="sync",
        workers=5,
        preload_app=True,
        accesslog="-",
        errorlog="-",
        loglevel="debug",
        capture_output=True,
        keepalive=60,
        debug=True,
    )