diff options
author | Robert Coup <robert@coup.net.nz> | 2019-12-19 12:27:11 +0000 |
---|---|---|
committer | Marcel Hellkamp <marc@gsites.de> | 2019-12-19 13:59:39 +0100 |
commit | 48e9dfef69d94d1acabb46cd6976acfcc214377b (patch) | |
tree | a995331c3e3d3f42c29b63ff23984f2617fa3837 | |
parent | 71fc15feb22f8afd3ccf5df461917fd94d4b3c2d (diff) | |
download | bottle-48e9dfef69d94d1acabb46cd6976acfcc214377b.tar.gz |
gunicorn: switch to use BaseApplication
This means configuration is only pulled from what is supplied through Bottle, not (for example) re-parsed from the commandline. Follows documented approach at http://docs.gunicorn.org/en/stable/custom.html
-rwxr-xr-x | bottle.py | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -3461,7 +3461,7 @@ class GunicornServer(ServerAdapter): """ Untested. See http://gunicorn.org/configure.html for options. """ def run(self, handler): - from gunicorn.app.base import Application + from gunicorn.app.base import BaseApplication if self.host.startswith("unix:"): config = {'bind': self.host} @@ -3470,9 +3470,10 @@ class GunicornServer(ServerAdapter): config.update(self.options) - class GunicornApplication(Application): - def init(self, parser, opts, args): - return config + class GunicornApplication(BaseApplication): + def load_config(self): + for key, value in config.items(): + self.cfg.set(key, value) def load(self): return handler |