diff options
| author | Steve Piercy <web@stevepiercy.com> | 2017-07-03 20:47:07 -0700 |
|---|---|---|
| committer | Steve Piercy <web@stevepiercy.com> | 2017-07-03 20:47:07 -0700 |
| commit | e2c59262a9784cd227c1ca99ab11878cfd44e746 (patch) | |
| tree | 0483693cd2fa96889b8f6ea20d7760ae64724571 /docs | |
| parent | 4269f3da2802b07289ceb622cfe70938807f486d (diff) | |
| download | pyramid-e2c59262a9784cd227c1ca99ab11878cfd44e746.tar.gz pyramid-e2c59262a9784cd227c1ca99ab11878cfd44e746.tar.bz2 pyramid-e2c59262a9784cd227c1ca99ab11878cfd44e746.zip | |
Update example apps to use config context manager
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/narr/configuration.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/narr/configuration.rst b/docs/narr/configuration.rst index ee54e3acd..bbf01240e 100644 --- a/docs/narr/configuration.rst +++ b/docs/narr/configuration.rst @@ -47,9 +47,9 @@ configured imperatively: return Response('Hello world!') if __name__ == '__main__': - config = Configurator() - config.add_view(hello_world) - app = config.make_wsgi_app() + with Configurator() as config: + config.add_view(hello_world) + app = config.make_wsgi_app() server = make_server('0.0.0.0', 8080, app) server.serve_forever() @@ -116,9 +116,9 @@ and its subpackages. For example: return Response('Hello') if __name__ == '__main__': - config = Configurator() - config.scan() - app = config.make_wsgi_app() + with Configurator() as config: + config.scan() + app = config.make_wsgi_app() server = make_server('0.0.0.0', 8080, app) server.serve_forever() |
