summaryrefslogtreecommitdiff
path: root/docs/getting_started/quick_glance
diff options
context:
space:
mode:
authorPaul Everitt <paul@agendaless.com>2013-08-06 10:12:42 -0400
committerPaul Everitt <paul@agendaless.com>2013-08-06 10:12:42 -0400
commit71b83e5ea328b654f8463f567ecc054a55a7a90b (patch)
tree7ba977a3592446142d5c4ea180d7b71bc2f31dbc /docs/getting_started/quick_glance
parentc3e696a0cfb839c97e6c20277dc797dbd5349730 (diff)
downloadpyramid-71b83e5ea328b654f8463f567ecc054a55a7a90b.tar.gz
pyramid-71b83e5ea328b654f8463f567ecc054a55a7a90b.tar.bz2
pyramid-71b83e5ea328b654f8463f567ecc054a55a7a90b.zip
Move sample code into subdirectories. Add sections for requests and views.
Diffstat (limited to 'docs/getting_started/quick_glance')
-rw-r--r--docs/getting_started/quick_glance/app4.jinja210
-rw-r--r--docs/getting_started/quick_glance/app4.py19
-rw-r--r--docs/getting_started/quick_glance/hello_world/app.py (renamed from docs/getting_started/quick_glance/app1.py)2
-rw-r--r--docs/getting_started/quick_glance/jinja2/app.py (renamed from docs/getting_started/quick_glance/app3.py)2
-rw-r--r--docs/getting_started/quick_glance/jinja2/hello_world.jinja2 (renamed from docs/getting_started/quick_glance/app3.jinja2)0
-rw-r--r--docs/getting_started/quick_glance/json/app.py (renamed from docs/getting_started/quick_glance/app5.py)2
-rw-r--r--docs/getting_started/quick_glance/package/CHANGES.txt (renamed from docs/getting_started/quick_glance/hello_world/CHANGES.txt)0
-rw-r--r--docs/getting_started/quick_glance/package/MANIFEST.in (renamed from docs/getting_started/quick_glance/hello_world/MANIFEST.in)0
-rw-r--r--docs/getting_started/quick_glance/package/README.txt (renamed from docs/getting_started/quick_glance/hello_world/README.txt)0
-rw-r--r--docs/getting_started/quick_glance/package/development.ini (renamed from docs/getting_started/quick_glance/hello_world/development.ini)0
-rw-r--r--docs/getting_started/quick_glance/package/hello_world/__init__.py (renamed from docs/getting_started/quick_glance/hello_world/hello_world/__init__.py)0
-rw-r--r--docs/getting_started/quick_glance/package/hello_world/locale/de/LC_MESSAGES/hello_world.mo (renamed from docs/getting_started/quick_glance/hello_world/hello_world/locale/de/LC_MESSAGES/hello_world.mo)bin460 -> 460 bytes
-rw-r--r--docs/getting_started/quick_glance/package/hello_world/locale/de/LC_MESSAGES/hello_world.po (renamed from docs/getting_started/quick_glance/hello_world/hello_world/locale/de/LC_MESSAGES/hello_world.po)0
-rw-r--r--docs/getting_started/quick_glance/package/hello_world/locale/fr/LC_MESSAGES/hello_world.mo (renamed from docs/getting_started/quick_glance/hello_world/hello_world/locale/fr/LC_MESSAGES/hello_world.mo)bin461 -> 461 bytes
-rw-r--r--docs/getting_started/quick_glance/package/hello_world/locale/fr/LC_MESSAGES/hello_world.po (renamed from docs/getting_started/quick_glance/hello_world/hello_world/locale/fr/LC_MESSAGES/hello_world.po)0
-rw-r--r--docs/getting_started/quick_glance/package/hello_world/locale/hello_world.pot (renamed from docs/getting_started/quick_glance/hello_world/hello_world/locale/hello_world.pot)0
-rw-r--r--docs/getting_started/quick_glance/package/hello_world/models.py (renamed from docs/getting_started/quick_glance/hello_world/hello_world/models.py)0
-rw-r--r--docs/getting_started/quick_glance/package/hello_world/static/favicon.ico (renamed from docs/getting_started/quick_glance/hello_world/hello_world/static/favicon.ico)bin1406 -> 1406 bytes
-rw-r--r--docs/getting_started/quick_glance/package/hello_world/static/logo.png (renamed from docs/getting_started/quick_glance/hello_world/hello_world/static/logo.png)bin6641 -> 6641 bytes
-rw-r--r--docs/getting_started/quick_glance/package/hello_world/static/pylons.css (renamed from docs/getting_started/quick_glance/hello_world/hello_world/static/pylons.css)0
-rw-r--r--docs/getting_started/quick_glance/package/hello_world/templates/mytemplate.jinja2 (renamed from docs/getting_started/quick_glance/hello_world/hello_world/templates/mytemplate.jinja2)0
-rw-r--r--docs/getting_started/quick_glance/package/hello_world/tests.py (renamed from docs/getting_started/quick_glance/hello_world/hello_world/tests.py)0
-rw-r--r--docs/getting_started/quick_glance/package/hello_world/views.py (renamed from docs/getting_started/quick_glance/hello_world/hello_world/views.py)0
-rw-r--r--docs/getting_started/quick_glance/package/message-extraction.ini (renamed from docs/getting_started/quick_glance/hello_world/message-extraction.ini)0
-rw-r--r--docs/getting_started/quick_glance/package/setup.cfg (renamed from docs/getting_started/quick_glance/hello_world/setup.cfg)0
-rw-r--r--docs/getting_started/quick_glance/package/setup.py (renamed from docs/getting_started/quick_glance/hello_world/setup.py)0
-rw-r--r--docs/getting_started/quick_glance/requests/app.py16
-rw-r--r--docs/getting_started/quick_glance/routing/app.py (renamed from docs/getting_started/quick_glance/app2.py)2
-rw-r--r--docs/getting_started/quick_glance/view_classes/app.py (renamed from docs/getting_started/quick_glance/app6.py)2
-rw-r--r--docs/getting_started/quick_glance/views/app.py10
-rw-r--r--docs/getting_started/quick_glance/views/views.py7
31 files changed, 38 insertions, 34 deletions
diff --git a/docs/getting_started/quick_glance/app4.jinja2 b/docs/getting_started/quick_glance/app4.jinja2
deleted file mode 100644
index 3d0f28c1f..000000000
--- a/docs/getting_started/quick_glance/app4.jinja2
+++ /dev/null
@@ -1,10 +0,0 @@
-<html lang="en">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>Quick Glance</title>
- <link rel="stylesheet" href="/static/app.css" />
-</head>
-<body>
-<h1>Hello {{ name }}!</h1>
-</body>
-</html> \ No newline at end of file
diff --git a/docs/getting_started/quick_glance/app4.py b/docs/getting_started/quick_glance/app4.py
deleted file mode 100644
index 245ed0b68..000000000
--- a/docs/getting_started/quick_glance/app4.py
+++ /dev/null
@@ -1,19 +0,0 @@
-from wsgiref.simple_server import make_server
-from pyramid.config import Configurator
-from pyramid.view import view_config
-
-
-@view_config(route_name='hello', renderer='app4.jinja2')
-def hello_world(request):
- return dict(name=request.matchdict['name'])
-
-
-if __name__ == '__main__':
- config = Configurator()
- config.add_route('hello', '/hello/{name}')
- config.add_static_view(name='static', path='static')
- config.include('pyramid_jinja2')
- config.scan()
- app = config.make_wsgi_app()
- server = make_server('0.0.0.0', 8081, app)
- server.serve_forever() \ No newline at end of file
diff --git a/docs/getting_started/quick_glance/app1.py b/docs/getting_started/quick_glance/hello_world/app.py
index cffe53ecf..df5a6cf18 100644
--- a/docs/getting_started/quick_glance/app1.py
+++ b/docs/getting_started/quick_glance/hello_world/app.py
@@ -12,5 +12,5 @@ if __name__ == '__main__':
config.add_route('hello', '/')
config.add_view(hello_world, route_name='hello')
app = config.make_wsgi_app()
- server = make_server('0.0.0.0', 8081, app)
+ server = make_server('0.0.0.0', 6543, app)
server.serve_forever() \ No newline at end of file
diff --git a/docs/getting_started/quick_glance/app3.py b/docs/getting_started/quick_glance/jinja2/app.py
index 549cb5f54..bee50373b 100644
--- a/docs/getting_started/quick_glance/app3.py
+++ b/docs/getting_started/quick_glance/jinja2/app.py
@@ -15,5 +15,5 @@ if __name__ == '__main__':
config.include('pyramid_jinja2')
config.scan()
app = config.make_wsgi_app()
- server = make_server('0.0.0.0', 8081, app)
+ server = make_server('0.0.0.0', 6543, app)
server.serve_forever() \ No newline at end of file
diff --git a/docs/getting_started/quick_glance/app3.jinja2 b/docs/getting_started/quick_glance/jinja2/hello_world.jinja2
index 6d9f0cd5f..6d9f0cd5f 100644
--- a/docs/getting_started/quick_glance/app3.jinja2
+++ b/docs/getting_started/quick_glance/jinja2/hello_world.jinja2
diff --git a/docs/getting_started/quick_glance/app5.py b/docs/getting_started/quick_glance/json/app.py
index 245a0a5ae..9b47fdeaf 100644
--- a/docs/getting_started/quick_glance/app5.py
+++ b/docs/getting_started/quick_glance/json/app.py
@@ -22,5 +22,5 @@ if __name__ == '__main__':
config.include('pyramid_jinja2')
config.scan()
app = config.make_wsgi_app()
- server = make_server('0.0.0.0', 8081, app)
+ server = make_server('0.0.0.0', 6543, app)
server.serve_forever() \ No newline at end of file
diff --git a/docs/getting_started/quick_glance/hello_world/CHANGES.txt b/docs/getting_started/quick_glance/package/CHANGES.txt
index ffa255da8..ffa255da8 100644
--- a/docs/getting_started/quick_glance/hello_world/CHANGES.txt
+++ b/docs/getting_started/quick_glance/package/CHANGES.txt
diff --git a/docs/getting_started/quick_glance/hello_world/MANIFEST.in b/docs/getting_started/quick_glance/package/MANIFEST.in
index 18fbd855c..18fbd855c 100644
--- a/docs/getting_started/quick_glance/hello_world/MANIFEST.in
+++ b/docs/getting_started/quick_glance/package/MANIFEST.in
diff --git a/docs/getting_started/quick_glance/hello_world/README.txt b/docs/getting_started/quick_glance/package/README.txt
index 63aaf6fbd..63aaf6fbd 100644
--- a/docs/getting_started/quick_glance/hello_world/README.txt
+++ b/docs/getting_started/quick_glance/package/README.txt
diff --git a/docs/getting_started/quick_glance/hello_world/development.ini b/docs/getting_started/quick_glance/package/development.ini
index 9aa5f40cf..9aa5f40cf 100644
--- a/docs/getting_started/quick_glance/hello_world/development.ini
+++ b/docs/getting_started/quick_glance/package/development.ini
diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/__init__.py b/docs/getting_started/quick_glance/package/hello_world/__init__.py
index 9b5753c26..9b5753c26 100644
--- a/docs/getting_started/quick_glance/hello_world/hello_world/__init__.py
+++ b/docs/getting_started/quick_glance/package/hello_world/__init__.py
diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/locale/de/LC_MESSAGES/hello_world.mo b/docs/getting_started/quick_glance/package/hello_world/locale/de/LC_MESSAGES/hello_world.mo
index 40bf0c271..40bf0c271 100644
--- a/docs/getting_started/quick_glance/hello_world/hello_world/locale/de/LC_MESSAGES/hello_world.mo
+++ b/docs/getting_started/quick_glance/package/hello_world/locale/de/LC_MESSAGES/hello_world.mo
Binary files differ
diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/locale/de/LC_MESSAGES/hello_world.po b/docs/getting_started/quick_glance/package/hello_world/locale/de/LC_MESSAGES/hello_world.po
index 0df243dba..0df243dba 100644
--- a/docs/getting_started/quick_glance/hello_world/hello_world/locale/de/LC_MESSAGES/hello_world.po
+++ b/docs/getting_started/quick_glance/package/hello_world/locale/de/LC_MESSAGES/hello_world.po
diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/locale/fr/LC_MESSAGES/hello_world.mo b/docs/getting_started/quick_glance/package/hello_world/locale/fr/LC_MESSAGES/hello_world.mo
index 4fc438bfe..4fc438bfe 100644
--- a/docs/getting_started/quick_glance/hello_world/hello_world/locale/fr/LC_MESSAGES/hello_world.mo
+++ b/docs/getting_started/quick_glance/package/hello_world/locale/fr/LC_MESSAGES/hello_world.mo
Binary files differ
diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/locale/fr/LC_MESSAGES/hello_world.po b/docs/getting_started/quick_glance/package/hello_world/locale/fr/LC_MESSAGES/hello_world.po
index dc0aae5d7..dc0aae5d7 100644
--- a/docs/getting_started/quick_glance/hello_world/hello_world/locale/fr/LC_MESSAGES/hello_world.po
+++ b/docs/getting_started/quick_glance/package/hello_world/locale/fr/LC_MESSAGES/hello_world.po
diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/locale/hello_world.pot b/docs/getting_started/quick_glance/package/hello_world/locale/hello_world.pot
index 9c9460cb2..9c9460cb2 100644
--- a/docs/getting_started/quick_glance/hello_world/hello_world/locale/hello_world.pot
+++ b/docs/getting_started/quick_glance/package/hello_world/locale/hello_world.pot
diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/models.py b/docs/getting_started/quick_glance/package/hello_world/models.py
index edd361c9c..edd361c9c 100644
--- a/docs/getting_started/quick_glance/hello_world/hello_world/models.py
+++ b/docs/getting_started/quick_glance/package/hello_world/models.py
diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/static/favicon.ico b/docs/getting_started/quick_glance/package/hello_world/static/favicon.ico
index 71f837c9e..71f837c9e 100644
--- a/docs/getting_started/quick_glance/hello_world/hello_world/static/favicon.ico
+++ b/docs/getting_started/quick_glance/package/hello_world/static/favicon.ico
Binary files differ
diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/static/logo.png b/docs/getting_started/quick_glance/package/hello_world/static/logo.png
index 88f5d9865..88f5d9865 100644
--- a/docs/getting_started/quick_glance/hello_world/hello_world/static/logo.png
+++ b/docs/getting_started/quick_glance/package/hello_world/static/logo.png
Binary files differ
diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/static/pylons.css b/docs/getting_started/quick_glance/package/hello_world/static/pylons.css
index 42e2e320e..42e2e320e 100644
--- a/docs/getting_started/quick_glance/hello_world/hello_world/static/pylons.css
+++ b/docs/getting_started/quick_glance/package/hello_world/static/pylons.css
diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/templates/mytemplate.jinja2 b/docs/getting_started/quick_glance/package/hello_world/templates/mytemplate.jinja2
index 998edfe12..998edfe12 100644
--- a/docs/getting_started/quick_glance/hello_world/hello_world/templates/mytemplate.jinja2
+++ b/docs/getting_started/quick_glance/package/hello_world/templates/mytemplate.jinja2
diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/tests.py b/docs/getting_started/quick_glance/package/hello_world/tests.py
index a81c29eb0..a81c29eb0 100644
--- a/docs/getting_started/quick_glance/hello_world/hello_world/tests.py
+++ b/docs/getting_started/quick_glance/package/hello_world/tests.py
diff --git a/docs/getting_started/quick_glance/hello_world/hello_world/views.py b/docs/getting_started/quick_glance/package/hello_world/views.py
index c271d45dd..c271d45dd 100644
--- a/docs/getting_started/quick_glance/hello_world/hello_world/views.py
+++ b/docs/getting_started/quick_glance/package/hello_world/views.py
diff --git a/docs/getting_started/quick_glance/hello_world/message-extraction.ini b/docs/getting_started/quick_glance/package/message-extraction.ini
index 0c3d54bc1..0c3d54bc1 100644
--- a/docs/getting_started/quick_glance/hello_world/message-extraction.ini
+++ b/docs/getting_started/quick_glance/package/message-extraction.ini
diff --git a/docs/getting_started/quick_glance/hello_world/setup.cfg b/docs/getting_started/quick_glance/package/setup.cfg
index 186e796fc..186e796fc 100644
--- a/docs/getting_started/quick_glance/hello_world/setup.cfg
+++ b/docs/getting_started/quick_glance/package/setup.cfg
diff --git a/docs/getting_started/quick_glance/hello_world/setup.py b/docs/getting_started/quick_glance/package/setup.py
index 6269accf1..6269accf1 100644
--- a/docs/getting_started/quick_glance/hello_world/setup.py
+++ b/docs/getting_started/quick_glance/package/setup.py
diff --git a/docs/getting_started/quick_glance/requests/app.py b/docs/getting_started/quick_glance/requests/app.py
new file mode 100644
index 000000000..df5a6cf18
--- /dev/null
+++ b/docs/getting_started/quick_glance/requests/app.py
@@ -0,0 +1,16 @@
+from wsgiref.simple_server import make_server
+from pyramid.config import Configurator
+from pyramid.response import Response
+
+
+def hello_world(request):
+ return Response('<h1>Hello World!</h1>')
+
+
+if __name__ == '__main__':
+ config = Configurator()
+ config.add_route('hello', '/')
+ config.add_view(hello_world, route_name='hello')
+ app = config.make_wsgi_app()
+ server = make_server('0.0.0.0', 6543, app)
+ server.serve_forever() \ No newline at end of file
diff --git a/docs/getting_started/quick_glance/app2.py b/docs/getting_started/quick_glance/routing/app.py
index 49ccd3be1..bbae35b07 100644
--- a/docs/getting_started/quick_glance/app2.py
+++ b/docs/getting_started/quick_glance/routing/app.py
@@ -14,5 +14,5 @@ if __name__ == '__main__':
config.add_route('hello', '/hello/{name}')
config.scan()
app = config.make_wsgi_app()
- server = make_server('0.0.0.0', 8081, app)
+ server = make_server('0.0.0.0', 6543, app)
server.serve_forever() \ No newline at end of file
diff --git a/docs/getting_started/quick_glance/app6.py b/docs/getting_started/quick_glance/view_classes/app.py
index 155becc54..90978344b 100644
--- a/docs/getting_started/quick_glance/app6.py
+++ b/docs/getting_started/quick_glance/view_classes/app.py
@@ -26,5 +26,5 @@ if __name__ == '__main__':
config.include('pyramid_jinja2')
config.scan()
app = config.make_wsgi_app()
- server = make_server('0.0.0.0', 8081, app)
+ server = make_server('0.0.0.0', 6543, app)
server.serve_forever() \ No newline at end of file
diff --git a/docs/getting_started/quick_glance/views/app.py b/docs/getting_started/quick_glance/views/app.py
new file mode 100644
index 000000000..1e12b6581
--- /dev/null
+++ b/docs/getting_started/quick_glance/views/app.py
@@ -0,0 +1,10 @@
+from wsgiref.simple_server import make_server
+from pyramid.config import Configurator
+
+if __name__ == '__main__':
+ config = Configurator()
+ config.add_route('hello', '/hello/{name}')
+ config.scan('views')
+ app = config.make_wsgi_app()
+ server = make_server('0.0.0.0', 6543, app)
+ server.serve_forever() \ No newline at end of file
diff --git a/docs/getting_started/quick_glance/views/views.py b/docs/getting_started/quick_glance/views/views.py
new file mode 100644
index 000000000..53a6a273a
--- /dev/null
+++ b/docs/getting_started/quick_glance/views/views.py
@@ -0,0 +1,7 @@
+from pyramid.response import Response
+from pyramid.view import view_config
+
+
+@view_config(route_name='hello')
+def hello_world(request):
+ return Response('<h1>Hello %(name)s!</h1>' % request.matchdict)