[PATCH 07/11] nmweb: shim for launching from gunicorn
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Sun Feb 4 20:19:55 PST 2018
file:///usr/share/doc/python-webpy-doc/html/deploying.html suggests
that gunicorn is an efficient way to deploy a webpy-based WSGI daemon.
This script is glue between nmweb.py and gunicorn.
---
contrib/notmuch-web/nmgunicorn.py | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 contrib/notmuch-web/nmgunicorn.py
diff --git a/contrib/notmuch-web/nmgunicorn.py b/contrib/notmuch-web/nmgunicorn.py
new file mode 100644
index 00000000..e71ba12a
--- /dev/null
+++ b/contrib/notmuch-web/nmgunicorn.py
@@ -0,0 +1,11 @@
+#!/usr/bin/env python3
+
+# to launch nmweb from gunicorn.
+
+from nmweb import urls, index, search, show
+import web
+
+app = web.application(urls, globals())
+
+# get the wsgi app from web.py application object
+wsgiapp = app.wsgifunc()
--
2.15.1
More information about the notmuch
mailing list