summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Coup <robert@coup.net.nz>2019-12-19 12:27:11 +0000
committerMarcel Hellkamp <marc@gsites.de>2019-12-19 13:59:39 +0100
commit48e9dfef69d94d1acabb46cd6976acfcc214377b (patch)
treea995331c3e3d3f42c29b63ff23984f2617fa3837
parent71fc15feb22f8afd3ccf5df461917fd94d4b3c2d (diff)
downloadbottle-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-xbottle.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/bottle.py b/bottle.py
index a590c4c..18aa69f 100755
--- a/bottle.py
+++ b/bottle.py
@@ -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