diff options
| author | Steve Piercy <web@stevepiercy.com> | 2016-12-25 03:47:10 -0800 |
|---|---|---|
| committer | Steve Piercy <web@stevepiercy.com> | 2016-12-25 03:47:10 -0800 |
| commit | 5fadd8838d922ccbd084421af51715992bce12ee (patch) | |
| tree | 8a022158607a9f9de7ecac1f90e4d64948cdde8f /docs/quick_tour | |
| parent | b488f7f72ff36526cf21798c91c7f09eaf1afa7a (diff) | |
| download | pyramid-5fadd8838d922ccbd084421af51715992bce12ee.tar.gz pyramid-5fadd8838d922ccbd084421af51715992bce12ee.tar.bz2 pyramid-5fadd8838d922ccbd084421af51715992bce12ee.zip | |
quick_tour - "Databases" updates for cookiecutter
- add ALL src files
Diffstat (limited to 'docs/quick_tour')
| -rw-r--r-- | docs/quick_tour/sqla_demo/.coveragerc | 3 | ||||
| -rw-r--r-- | docs/quick_tour/sqla_demo/pytest.ini | 3 | ||||
| -rw-r--r-- | docs/quick_tour/sqla_demo/sqla_demo/routes.py | 3 | ||||
| -rw-r--r-- | docs/quick_tour/sqla_demo/sqla_demo/templates/404.jinja2 | 8 | ||||
| -rw-r--r-- | docs/quick_tour/sqla_demo/sqla_demo/views/notfound.py | 7 |
5 files changed, 24 insertions, 0 deletions
diff --git a/docs/quick_tour/sqla_demo/.coveragerc b/docs/quick_tour/sqla_demo/.coveragerc new file mode 100644 index 000000000..918f8dea0 --- /dev/null +++ b/docs/quick_tour/sqla_demo/.coveragerc @@ -0,0 +1,3 @@ +[run] +source = sqla_demo +omit = sqla_demo/test* diff --git a/docs/quick_tour/sqla_demo/pytest.ini b/docs/quick_tour/sqla_demo/pytest.ini new file mode 100644 index 000000000..2d7535841 --- /dev/null +++ b/docs/quick_tour/sqla_demo/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +testpaths = sqla_demo +python_files = *.py diff --git a/docs/quick_tour/sqla_demo/sqla_demo/routes.py b/docs/quick_tour/sqla_demo/sqla_demo/routes.py new file mode 100644 index 000000000..25504ad4d --- /dev/null +++ b/docs/quick_tour/sqla_demo/sqla_demo/routes.py @@ -0,0 +1,3 @@ +def includeme(config): + config.add_static_view('static', 'static', cache_max_age=3600) + config.add_route('home', '/') diff --git a/docs/quick_tour/sqla_demo/sqla_demo/templates/404.jinja2 b/docs/quick_tour/sqla_demo/sqla_demo/templates/404.jinja2 new file mode 100644 index 000000000..1917f83c7 --- /dev/null +++ b/docs/quick_tour/sqla_demo/sqla_demo/templates/404.jinja2 @@ -0,0 +1,8 @@ +{% extends "layout.jinja2" %} + +{% block content %} +<div class="content"> + <h1><span class="font-semi-bold">Pyramid</span> <span class="smaller">Alchemy scaffold</span></h1> + <p class="lead"><span class="font-semi-bold">404</span> Page Not Found</p> +</div> +{% endblock content %} diff --git a/docs/quick_tour/sqla_demo/sqla_demo/views/notfound.py b/docs/quick_tour/sqla_demo/sqla_demo/views/notfound.py new file mode 100644 index 000000000..69d6e2804 --- /dev/null +++ b/docs/quick_tour/sqla_demo/sqla_demo/views/notfound.py @@ -0,0 +1,7 @@ +from pyramid.view import notfound_view_config + + +@notfound_view_config(renderer='../templates/404.jinja2') +def notfound_view(request): + request.response.status = 404 + return {} |
