diff options
author | Michael Merickel <michael@merickel.org> | 2022-05-15 20:24:52 -0500 |
---|---|---|
committer | Michael Merickel <michael@merickel.org> | 2022-05-15 20:41:32 -0500 |
commit | 617bc4c2eba62701de64196e1199c93cc7277ce4 (patch) | |
tree | 435aa3d6456da966a81cac6febeace7021c3ec89 /src/paste/deploy/paster_templates/paste_deploy/+package+/wsgiapp.py_tmpl | |
parent | ee1d364dabd544fe4bf355b2c6578e4237b03992 (diff) | |
download | pastedeploy-git-617bc4c2eba62701de64196e1199c93cc7277ce4.tar.gz |
refactor to a src folder
Diffstat (limited to 'src/paste/deploy/paster_templates/paste_deploy/+package+/wsgiapp.py_tmpl')
-rw-r--r-- | src/paste/deploy/paster_templates/paste_deploy/+package+/wsgiapp.py_tmpl | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/paste/deploy/paster_templates/paste_deploy/+package+/wsgiapp.py_tmpl b/src/paste/deploy/paster_templates/paste_deploy/+package+/wsgiapp.py_tmpl new file mode 100644 index 0000000..5684c31 --- /dev/null +++ b/src/paste/deploy/paster_templates/paste_deploy/+package+/wsgiapp.py_tmpl @@ -0,0 +1,25 @@ +from __future__ import absolute_import +from paste.deploy.config import ConfigMiddleware + +from . import sampleapp + + +def make_app( + global_conf, + # Optional and required configuration parameters + # can go here, or just **kw; greeting is required: + greeting, + **kw): + # This is a WSGI application: + app = sampleapp.application + # Here we merge all the keys into one configuration + # dictionary; you don't have to do this, but this + # can be convenient later to add ad hoc configuration: + conf = global_conf.copy() + conf.update(kw) + conf['greeting'] = greeting + # ConfigMiddleware means that paste.deploy.CONFIG will, + # during this request (threadsafe) represent the + # configuration dictionary we set up: + app = ConfigMiddleware(app, conf) + return app |