diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/mailman/rest/gunicorn.py | 16 | ||||
| -rw-r--r-- | src/mailman/rest/wsgiapp.py | 6 |
2 files changed, 10 insertions, 12 deletions
diff --git a/src/mailman/rest/gunicorn.py b/src/mailman/rest/gunicorn.py index e628dcd61..79e4ac504 100644 --- a/src/mailman/rest/gunicorn.py +++ b/src/mailman/rest/gunicorn.py @@ -35,16 +35,18 @@ __all__ = [ 'make_application', ] +# Initializing the Mailman system once. +from mailman.core.initialize import initialize +initialize() +from mailman.rest.wsgiapp import make_application as base_application +app = base_application() - -def make_application(): - """Create the WSGI application, after initializing the Mailman system. + +def make_application(environ, start_response): + """Create the WSGI application. Use this if you want to integrate Mailman's REST server with an external WSGI server, such as gunicorn. Be sure to set the $MAILMAN_CONFIG_FILE environment variable. """ - from mailman.core.initialize import initialize - initialize() - from mailman.rest.wsgiapp import make_application as base_application - return base_application() + return app(environ, start_response) diff --git a/src/mailman/rest/wsgiapp.py b/src/mailman/rest/wsgiapp.py index 83922ce9d..70d756405 100644 --- a/src/mailman/rest/wsgiapp.py +++ b/src/mailman/rest/wsgiapp.py @@ -216,11 +216,7 @@ class RootedAPI(API): @public def make_application(): - """Create the WSGI application. - - Use this if you want to integrate Mailman's REST server with your own WSGI - server. - """ + """Return a callable WSGI application object.""" return RootedAPI(Root()) |
