summaryrefslogtreecommitdiff
path: root/docs/quick_tour/json
diff options
context:
space:
mode:
authorSteve Piercy <web@stevepiercy.com>2016-01-22 00:29:38 -0800
committerSteve Piercy <web@stevepiercy.com>2016-01-22 00:29:38 -0800
commit257ac062342d5b2cd18b47737cf9fb94aa528b8a (patch)
tree3cf0878f41f7186d600044774365126dd47ea559 /docs/quick_tour/json
parentcdeda1bf3329e8c6ba1e86e699e205024471ca93 (diff)
downloadpyramid-257ac062342d5b2cd18b47737cf9fb94aa528b8a.tar.gz
pyramid-257ac062342d5b2cd18b47737cf9fb94aa528b8a.tar.bz2
pyramid-257ac062342d5b2cd18b47737cf9fb94aa528b8a.zip
Overhaul Quick Tour: start to "Quick project startup with scaffolds"
Diffstat (limited to 'docs/quick_tour/json')
-rw-r--r--docs/quick_tour/json/app.py4
-rw-r--r--docs/quick_tour/json/hello_world.jinja24
-rw-r--r--docs/quick_tour/json/hello_world.pt17
-rw-r--r--docs/quick_tour/json/views.py4
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