summaryrefslogtreecommitdiff
path: root/docs/quick_tour/static_assets
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/static_assets
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/static_assets')
-rw-r--r--docs/quick_tour/static_assets/app.py4
-rw-r--r--docs/quick_tour/static_assets/hello_world.jinja22
-rw-r--r--docs/quick_tour/static_assets/hello_world.pt16
-rw-r--r--docs/quick_tour/static_assets/hello_world_static.jinja210
-rw-r--r--docs/quick_tour/static_assets/views.py2
5 files changed, 13 insertions, 21 deletions
diff --git a/docs/quick_tour/static_assets/app.py b/docs/quick_tour/static_assets/app.py
index 9c808972f..1849c0a5a 100644
--- a/docs/quick_tour/static_assets/app.py
+++ b/docs/quick_tour/static_assets/app.py
@@ -4,11 +4,9 @@ from pyramid.config import Configurator
if __name__ == '__main__':
config = Configurator()
config.add_route('hello', '/howdy/{name}')
- # Start Static 1
config.add_static_view(name='static', path='static')
- # End Static 1
config.include('pyramid_jinja2')
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/static_assets/hello_world.jinja2 b/docs/quick_tour/static_assets/hello_world.jinja2
index f6862e618..0fb2ce296 100644
--- a/docs/quick_tour/static_assets/hello_world.jinja2
+++ b/docs/quick_tour/static_assets/hello_world.jinja2
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
- <title>Quick Glance</title>
+ <title>Hello World</title>
<link rel="stylesheet" href="/static/app.css"/>
</head>
<body>
diff --git a/docs/quick_tour/static_assets/hello_world.pt b/docs/quick_tour/static_assets/hello_world.pt
deleted file mode 100644
index 1797146eb..000000000
--- a/docs/quick_tour/static_assets/hello_world.pt
+++ /dev/null
@@ -1,16 +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/static_assets/hello_world_static.jinja2 b/docs/quick_tour/static_assets/hello_world_static.jinja2
new file mode 100644
index 000000000..4fb9be074
--- /dev/null
+++ b/docs/quick_tour/static_assets/hello_world_static.jinja2
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <title>Hello World</title>
+ <link rel="stylesheet" href="{{ request.static_url('static/app.css') }}"/>
+</head>
+<body>
+<h1>Hello {{ name }}!</h1>
+</body>
+</html> \ No newline at end of file
diff --git a/docs/quick_tour/static_assets/views.py b/docs/quick_tour/static_assets/views.py
index 90730ae32..7dbb45287 100644
--- a/docs/quick_tour/static_assets/views.py
+++ b/docs/quick_tour/static_assets/views.py
@@ -1,6 +1,6 @@
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'])