summaryrefslogtreecommitdiff
path: root/docs/quick_tour/sqla_demo
diff options
context:
space:
mode:
authorSteve Piercy <web@stevepiercy.com>2019-12-25 03:35:14 -0800
committerSteve Piercy <web@stevepiercy.com>2020-01-02 23:30:59 -0800
commit94fd8de4263dc6294aa62425a5f98d905ef0584a (patch)
treeda1ca3fbd3f57748663e7a2b43061de52de7c282 /docs/quick_tour/sqla_demo
parentcc396692d82441f8142fb14041542ebd2dad6f0a (diff)
downloadpyramid-94fd8de4263dc6294aa62425a5f98d905ef0584a.tar.gz
pyramid-94fd8de4263dc6294aa62425a5f98d905ef0584a.tar.bz2
pyramid-94fd8de4263dc6294aa62425a5f98d905ef0584a.zip
Update quick_tour with cookiecutter master branch
Diffstat (limited to 'docs/quick_tour/sqla_demo')
-rw-r--r--docs/quick_tour/sqla_demo/development.ini7
-rw-r--r--docs/quick_tour/sqla_demo/production.ini7
-rw-r--r--docs/quick_tour/sqla_demo/setup.py10
-rw-r--r--docs/quick_tour/sqla_demo/sqla_demo/__init__.py2
-rw-r--r--docs/quick_tour/sqla_demo/sqla_demo/alembic/script.py.mako2
-rw-r--r--docs/quick_tour/sqla_demo/sqla_demo/alembic/versions/README.txt2
-rw-r--r--docs/quick_tour/sqla_demo/sqla_demo/pshell.py1
-rw-r--r--docs/quick_tour/sqla_demo/sqla_demo/templates/404.jinja22
-rw-r--r--docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja22
-rw-r--r--docs/quick_tour/sqla_demo/sqla_demo/templates/mytemplate.jinja24
-rw-r--r--docs/quick_tour/sqla_demo/sqla_demo/tests.py3
-rw-r--r--docs/quick_tour/sqla_demo/sqla_demo/views/default.py4
12 files changed, 28 insertions, 18 deletions
diff --git a/docs/quick_tour/sqla_demo/development.ini b/docs/quick_tour/sqla_demo/development.ini
index 056a672e4..a087e17a7 100644
--- a/docs/quick_tour/sqla_demo/development.ini
+++ b/docs/quick_tour/sqla_demo/development.ini
@@ -45,7 +45,7 @@ listen = localhost:6543
###
[loggers]
-keys = root, sqla_demo, sqlalchemy
+keys = root, sqla_demo, sqlalchemy, alembic
[handlers]
keys = console
@@ -70,6 +70,11 @@ qualname = sqlalchemy.engine
# "level = DEBUG" logs SQL queries and results.
# "level = WARN" logs neither. (Recommended for production systems.)
+[logger_alembic]
+level = INFO
+handlers =
+qualname = alembic
+
[handler_console]
class = StreamHandler
args = (sys.stderr,)
diff --git a/docs/quick_tour/sqla_demo/production.ini b/docs/quick_tour/sqla_demo/production.ini
index fe7f946bd..ee588605d 100644
--- a/docs/quick_tour/sqla_demo/production.ini
+++ b/docs/quick_tour/sqla_demo/production.ini
@@ -39,7 +39,7 @@ listen = *:6543
###
[loggers]
-keys = root, sqla_demo, sqlalchemy
+keys = root, sqla_demo, sqlalchemy, alembic
[handlers]
keys = console
@@ -64,6 +64,11 @@ qualname = sqlalchemy.engine
# "level = DEBUG" logs SQL queries and results.
# "level = WARN" logs neither. (Recommended for production systems.)
+[logger_alembic]
+level = WARN
+handlers =
+qualname = alembic
+
[handler_console]
class = StreamHandler
args = (sys.stderr,)
diff --git a/docs/quick_tour/sqla_demo/setup.py b/docs/quick_tour/sqla_demo/setup.py
index 28a8e0815..23740ba9f 100644
--- a/docs/quick_tour/sqla_demo/setup.py
+++ b/docs/quick_tour/sqla_demo/setup.py
@@ -9,17 +9,17 @@ with open(os.path.join(here, 'CHANGES.txt')) as f:
CHANGES = f.read()
requires = [
- 'alembic',
'plaster_pastedeploy',
- 'pyramid >= 1.9',
- 'pyramid_debugtoolbar',
+ 'pyramid',
'pyramid_jinja2',
+ 'pyramid_debugtoolbar',
+ 'waitress',
+ 'alembic',
'pyramid_retry',
'pyramid_tm',
'SQLAlchemy',
'transaction',
'zope.sqlalchemy',
- 'waitress',
]
tests_require = [
@@ -55,7 +55,7 @@ setup(
'main = sqla_demo:main',
],
'console_scripts': [
- 'initialize_sqla_demo_db = sqla_demo.scripts.initialize_db:main',
+ 'initialize_sqla_demo_db=sqla_demo.scripts.initialize_db:main',
],
},
)
diff --git a/docs/quick_tour/sqla_demo/sqla_demo/__init__.py b/docs/quick_tour/sqla_demo/sqla_demo/__init__.py
index 28bd1f80d..5c2ba5cc0 100644
--- a/docs/quick_tour/sqla_demo/sqla_demo/__init__.py
+++ b/docs/quick_tour/sqla_demo/sqla_demo/__init__.py
@@ -5,8 +5,8 @@ def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
with Configurator(settings=settings) as config:
- config.include('pyramid_jinja2')
config.include('.models')
+ config.include('pyramid_jinja2')
config.include('.routes')
config.scan()
return config.make_wsgi_app()
diff --git a/docs/quick_tour/sqla_demo/sqla_demo/alembic/script.py.mako b/docs/quick_tour/sqla_demo/sqla_demo/alembic/script.py.mako
index 2c0156303..535780d13 100644
--- a/docs/quick_tour/sqla_demo/sqla_demo/alembic/script.py.mako
+++ b/docs/quick_tour/sqla_demo/sqla_demo/alembic/script.py.mako
@@ -15,10 +15,8 @@ down_revision = ${repr(down_revision)}
branch_labels = ${repr(branch_labels)}
depends_on = ${repr(depends_on)}
-
def upgrade():
${upgrades if upgrades else "pass"}
-
def downgrade():
${downgrades if downgrades else "pass"}
diff --git a/docs/quick_tour/sqla_demo/sqla_demo/alembic/versions/README.txt b/docs/quick_tour/sqla_demo/sqla_demo/alembic/versions/README.txt
index 09ed32c8d..b0d704d6a 100644
--- a/docs/quick_tour/sqla_demo/sqla_demo/alembic/versions/README.txt
+++ b/docs/quick_tour/sqla_demo/sqla_demo/alembic/versions/README.txt
@@ -1 +1 @@
-Placeholder for alembic versions \ No newline at end of file
+Placeholder for alembic versions
diff --git a/docs/quick_tour/sqla_demo/sqla_demo/pshell.py b/docs/quick_tour/sqla_demo/sqla_demo/pshell.py
index 108c04d5e..b0847ee90 100644
--- a/docs/quick_tour/sqla_demo/sqla_demo/pshell.py
+++ b/docs/quick_tour/sqla_demo/sqla_demo/pshell.py
@@ -1,5 +1,6 @@
from . import models
+
def setup(env):
request = env['request']
diff --git a/docs/quick_tour/sqla_demo/sqla_demo/templates/404.jinja2 b/docs/quick_tour/sqla_demo/sqla_demo/templates/404.jinja2
index 1917f83c7..aaf12413f 100644
--- a/docs/quick_tour/sqla_demo/sqla_demo/templates/404.jinja2
+++ b/docs/quick_tour/sqla_demo/sqla_demo/templates/404.jinja2
@@ -2,7 +2,7 @@
{% block content %}
<div class="content">
- <h1><span class="font-semi-bold">Pyramid</span> <span class="smaller">Alchemy scaffold</span></h1>
+ <h1><span class="font-semi-bold">Pyramid</span> <span class="smaller">Starter project</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/templates/layout.jinja2 b/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2
index 107691acf..82017688a 100644
--- a/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2
+++ b/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2
@@ -8,7 +8,7 @@
<meta name="author" content="Pylons Project">
<link rel="shortcut icon" href="{{request.static_url('sqla_demo:static/pyramid-16x16.png')}}">
- <title>Cookiecutter Alchemy project for the Pyramid Web Framework</title>
+ <title>Cookiecutter Starter project for the Pyramid Web Framework</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
diff --git a/docs/quick_tour/sqla_demo/sqla_demo/templates/mytemplate.jinja2 b/docs/quick_tour/sqla_demo/sqla_demo/templates/mytemplate.jinja2
index d8b0a4232..f2e7283f8 100644
--- a/docs/quick_tour/sqla_demo/sqla_demo/templates/mytemplate.jinja2
+++ b/docs/quick_tour/sqla_demo/sqla_demo/templates/mytemplate.jinja2
@@ -2,7 +2,7 @@
{% block content %}
<div class="content">
- <h1><span class="font-semi-bold">Pyramid</span> <span class="smaller">Alchemy project</span></h1>
+ <h1><span class="font-semi-bold">Pyramid</span> <span class="smaller">Starter project</span></h1>
<p class="lead">Welcome to <span class="font-normal">{{project}}</span>, a&nbsp;Pyramid application generated&nbsp;by<br><span class="font-normal">Cookiecutter</span>.</p>
</div>
-{% endblock content %} \ No newline at end of file
+{% endblock content %}
diff --git a/docs/quick_tour/sqla_demo/sqla_demo/tests.py b/docs/quick_tour/sqla_demo/sqla_demo/tests.py
index 6db538ffd..df9b58780 100644
--- a/docs/quick_tour/sqla_demo/sqla_demo/tests.py
+++ b/docs/quick_tour/sqla_demo/sqla_demo/tests.py
@@ -1,8 +1,9 @@
import unittest
-import transaction
from pyramid import testing
+import transaction
+
def dummy_request(dbsession):
return testing.DummyRequest(dbsession=dbsession)
diff --git a/docs/quick_tour/sqla_demo/sqla_demo/views/default.py b/docs/quick_tour/sqla_demo/sqla_demo/views/default.py
index f7ad4c8f2..a6b05c558 100644
--- a/docs/quick_tour/sqla_demo/sqla_demo/views/default.py
+++ b/docs/quick_tour/sqla_demo/sqla_demo/views/default.py
@@ -1,5 +1,5 @@
-from pyramid.response import Response
from pyramid.view import view_config
+from pyramid.response import Response
from sqlalchemy.exc import DBAPIError
@@ -21,7 +21,7 @@ Pyramid is having a problem using your SQL database. The problem
might be caused by one of the following things:
1. You may need to initialize your database tables with `alembic`.
- Check your README.txt for description and try to run it.
+ Check your README.txt for descriptions and try to run it.
2. Your database server may not be running. Check that the
database server referred to by the "sqlalchemy.url" setting in