diff options
| author | Michael Merickel <michael@merickel.org> | 2016-01-31 16:18:02 -0600 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2016-01-31 16:18:02 -0600 |
| commit | 3eb1c354d320536ee470b79dcb930d20da93d97d (patch) | |
| tree | 18aa7fa0a4293919c1ed67ee7f8aae6372abcb06 /docs/quick_tour/json | |
| parent | 67f733e161f19bb2b7322edd120b9bf489154536 (diff) | |
| parent | 9c01bf58c211bf9c28f8043459a5a0e9b25a5c35 (diff) | |
| download | pyramid-3eb1c354d320536ee470b79dcb930d20da93d97d.tar.gz pyramid-3eb1c354d320536ee470b79dcb930d20da93d97d.tar.bz2 pyramid-3eb1c354d320536ee470b79dcb930d20da93d97d.zip | |
Merge branch 'master' into feature/alchemy-scaffold-update
Diffstat (limited to 'docs/quick_tour/json')
| -rw-r--r-- | docs/quick_tour/json/app.py | 4 | ||||
| -rw-r--r-- | docs/quick_tour/json/hello_world.jinja2 | 4 | ||||
| -rw-r--r-- | docs/quick_tour/json/hello_world.pt | 17 | ||||
| -rw-r--r-- | docs/quick_tour/json/views.py | 4 |
4 files changed, 4 insertions, 25 deletions
diff --git a/docs/quick_tour/json/app.py b/docs/quick_tour/json/app.py index 950cb478f..40faddd00 100644 --- a/docs/quick_tour/json/app.py +++ b/docs/quick_tour/json/app.py @@ -1,8 +1,6 @@ from wsgiref.simple_server import make_server - from pyramid.config import Configurator - if __name__ == '__main__': config = Configurator() config.add_route('hello', '/howdy/{name}') @@ -12,4 +10,4 @@ if __name__ == '__main__': 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 + server.serve_forever() diff --git a/docs/quick_tour/json/hello_world.jinja2 b/docs/quick_tour/json/hello_world.jinja2 index f6862e618..4fb9be074 100644 --- a/docs/quick_tour/json/hello_world.jinja2 +++ b/docs/quick_tour/json/hello_world.jinja2 @@ -1,8 +1,8 @@ <!DOCTYPE html> <html lang="en"> <head> - <title>Quick Glance</title> - <link rel="stylesheet" href="/static/app.css"/> + <title>Hello World</title> + <link rel="stylesheet" href="{{ request.static_url('static/app.css') }}"/> </head> <body> <h1>Hello {{ name }}!</h1> diff --git a/docs/quick_tour/json/hello_world.pt b/docs/quick_tour/json/hello_world.pt deleted file mode 100644 index 711054aa9..000000000 --- a/docs/quick_tour/json/hello_world.pt +++ /dev/null @@ -1,17 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <title>Quick Glance</title> - <!-- Start Link 1 --> - <link rel="stylesheet" href="/static/app.css" /> - <!-- End Link 1 --> - <!-- Start Link 2 --> - <link rel="stylesheet" - href="${request.static_url('static/app.css')}" - /> - <!-- End Link 2 --> -</head> -<body> -<h1>Hello ${name}!</h1> -</body> -</html>
\ No newline at end of file diff --git a/docs/quick_tour/json/views.py b/docs/quick_tour/json/views.py index 583e220c7..22aa8aad6 100644 --- a/docs/quick_tour/json/views.py +++ b/docs/quick_tour/json/views.py @@ -1,13 +1,11 @@ from pyramid.view import view_config -@view_config(route_name='hello', renderer='hello_world.pt') +@view_config(route_name='hello', renderer='hello_world.jinja2') def hello_world(request): return dict(name=request.matchdict['name']) -# Start View 1 @view_config(route_name='hello_json', renderer='json') def hello_json(request): return [1, 2, 3] - # End View 1
\ No newline at end of file |
