diff options
| author | Paul Everitt <paul@agendaless.com> | 2013-09-16 09:22:24 -0400 |
|---|---|---|
| committer | Paul Everitt <paul@agendaless.com> | 2013-09-16 09:22:24 -0400 |
| commit | 55867d510658e5454e6b73055b944694b69f5668 (patch) | |
| tree | 4bc2ce31579d467494f7424eb15a8aa39477f988 /docs/quick_tutorial/ini | |
| parent | 63e18d797b4f10f6d06ec7ad25d3dadc85147ae2 (diff) | |
| parent | 4524d905975b481aee7f84b079a3abc5036508a6 (diff) | |
| download | pyramid-55867d510658e5454e6b73055b944694b69f5668.tar.gz pyramid-55867d510658e5454e6b73055b944694b69f5668.tar.bz2 pyramid-55867d510658e5454e6b73055b944694b69f5668.zip | |
Merge branch 'docs.quicktutorial'
Diffstat (limited to 'docs/quick_tutorial/ini')
| -rw-r--r-- | docs/quick_tutorial/ini/development.ini | 38 | ||||
| -rw-r--r-- | docs/quick_tutorial/ini/setup.py | 13 | ||||
| -rw-r--r-- | docs/quick_tutorial/ini/tutorial/__init__.py | 13 |
3 files changed, 64 insertions, 0 deletions
diff --git a/docs/quick_tutorial/ini/development.ini b/docs/quick_tutorial/ini/development.ini new file mode 100644 index 000000000..ca7d9bf81 --- /dev/null +++ b/docs/quick_tutorial/ini/development.ini @@ -0,0 +1,38 @@ +[app:main] +use = egg:tutorial + +[server:main] +use = egg:pyramid#wsgiref +host = 0.0.0.0 +port = 6543 + +# Begin logging configuration + +[loggers] +keys = root, tutorial + +[logger_tutorial] +level = DEBUG +handlers = +qualname = tutorial + +[handlers] +keys = console + +[formatters] +keys = generic + +[logger_root] +level = INFO +handlers = console + +[handler_console] +class = StreamHandler +args = (sys.stderr,) +level = NOTSET +formatter = generic + +[formatter_generic] +format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s + +# End logging configuration diff --git a/docs/quick_tutorial/ini/setup.py b/docs/quick_tutorial/ini/setup.py new file mode 100644 index 000000000..9997984d3 --- /dev/null +++ b/docs/quick_tutorial/ini/setup.py @@ -0,0 +1,13 @@ +from setuptools import setup + +requires = [ + 'pyramid', +] + +setup(name='tutorial', + install_requires=requires, + entry_points="""\ + [paste.app_factory] + main = tutorial:main + """, +)
\ No newline at end of file diff --git a/docs/quick_tutorial/ini/tutorial/__init__.py b/docs/quick_tutorial/ini/tutorial/__init__.py new file mode 100644 index 000000000..2b4e84f30 --- /dev/null +++ b/docs/quick_tutorial/ini/tutorial/__init__.py @@ -0,0 +1,13 @@ +from pyramid.config import Configurator +from pyramid.response import Response + + +def hello_world(request): + return Response('<body><h1>Hello World!</h1></body>') + + +def main(global_config, **settings): + config = Configurator(settings=settings) + config.add_route('hello', '/') + config.add_view(hello_world, route_name='hello') + return config.make_wsgi_app()
\ No newline at end of file |
