diff options
| author | Chris McDonough <chrism@plope.com> | 2018-03-13 17:19:44 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2018-03-13 17:19:44 -0400 |
| commit | bf59bd87ce2d8dc35f9585087623528bb58363a3 (patch) | |
| tree | ea5cb12fee6e4453bb8e0bf6b943e1451de7cc73 /docs/tutorials/wiki2/src/models | |
| parent | b2e8884a94d9e869bf29ea55298ad308f16ed420 (diff) | |
| parent | 47ff29297c65ae2c8da06a5bb2f361f806681ced (diff) | |
| download | pyramid-bf59bd87ce2d8dc35f9585087623528bb58363a3.tar.gz pyramid-bf59bd87ce2d8dc35f9585087623528bb58363a3.tar.bz2 pyramid-bf59bd87ce2d8dc35f9585087623528bb58363a3.zip | |
Merge branch 'master' of github.com:Pylons/pyramid
Diffstat (limited to 'docs/tutorials/wiki2/src/models')
8 files changed, 28 insertions, 18 deletions
diff --git a/docs/tutorials/wiki2/src/models/README.txt b/docs/tutorials/wiki2/src/models/README.txt index 8466fd7b5..7b33da610 100644 --- a/docs/tutorials/wiki2/src/models/README.txt +++ b/docs/tutorials/wiki2/src/models/README.txt @@ -1,12 +1,12 @@ myproj -=============================== +====== Getting Started --------------- - Change directory into your newly created project. - cd myproj + cd tutorial - Create a Python virtual environment. @@ -14,7 +14,7 @@ Getting Started - Upgrade packaging tools. - env/bin/pip install --upgrade pip setuptools wheel + env/bin/pip install --upgrade pip setuptools - Install the project in editable mode with its testing requirements. diff --git a/docs/tutorials/wiki2/src/models/development.ini b/docs/tutorials/wiki2/src/models/development.ini index e9f6d8d3f..4a67896b2 100644 --- a/docs/tutorials/wiki2/src/models/development.ini +++ b/docs/tutorials/wiki2/src/models/development.ini @@ -1,6 +1,6 @@ ### # app configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html +# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html ### [app:main] @@ -16,6 +16,8 @@ pyramid.includes = sqlalchemy.url = sqlite:///%(here)s/tutorial.sqlite +retry.attempts = 3 + # By default, the toolbar only appears for clients from IP addresses # '127.0.0.1' and '::1'. # debugtoolbar.hosts = 127.0.0.1 ::1 @@ -26,11 +28,11 @@ sqlalchemy.url = sqlite:///%(here)s/tutorial.sqlite [server:main] use = egg:waitress#main -listen = 127.0.0.1:6543 [::1]:6543 +listen = localhost:6543 ### # logging configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html +# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html ### [loggers] diff --git a/docs/tutorials/wiki2/src/models/production.ini b/docs/tutorials/wiki2/src/models/production.ini index c01ad9a7e..a28e47a83 100644 --- a/docs/tutorials/wiki2/src/models/production.ini +++ b/docs/tutorials/wiki2/src/models/production.ini @@ -1,6 +1,6 @@ ### # app configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html +# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html ### [app:main] @@ -14,6 +14,8 @@ pyramid.default_locale_name = en sqlalchemy.url = sqlite:///%(here)s/tutorial.sqlite +retry.attempts = 3 + ### # wsgi server configuration ### @@ -24,7 +26,7 @@ listen = *:6543 ### # logging configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html +# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html ### [loggers] diff --git a/docs/tutorials/wiki2/src/models/setup.py b/docs/tutorials/wiki2/src/models/setup.py index faf76aa27..c688c6866 100644 --- a/docs/tutorials/wiki2/src/models/setup.py +++ b/docs/tutorials/wiki2/src/models/setup.py @@ -10,9 +10,11 @@ with open(os.path.join(here, 'CHANGES.txt')) as f: requires = [ 'bcrypt', - 'pyramid', - 'pyramid_jinja2', + 'plaster_pastedeploy', + 'pyramid >= 1.9a', 'pyramid_debugtoolbar', + 'pyramid_jinja2', + 'pyramid_retry', 'pyramid_tm', 'SQLAlchemy', 'transaction', diff --git a/docs/tutorials/wiki2/src/models/tutorial/models/__init__.py b/docs/tutorials/wiki2/src/models/tutorial/models/__init__.py index 8147052ad..3c9ba8e54 100644 --- a/docs/tutorials/wiki2/src/models/tutorial/models/__init__.py +++ b/docs/tutorials/wiki2/src/models/tutorial/models/__init__.py @@ -58,10 +58,14 @@ def includeme(config): """ settings = config.get_settings() + settings['tm.manager_hook'] = 'pyramid_tm.explicit_manager' # use pyramid_tm to hook the transaction lifecycle to the request config.include('pyramid_tm') + # use pyramid_retry to retry a request when transient exceptions occur + config.include('pyramid_retry') + session_factory = get_session_factory(get_engine(settings)) config.registry['dbsession_factory'] = session_factory diff --git a/docs/tutorials/wiki2/src/models/tutorial/models/meta.py b/docs/tutorials/wiki2/src/models/tutorial/models/meta.py index 0682247b5..02285b3ff 100644 --- a/docs/tutorials/wiki2/src/models/tutorial/models/meta.py +++ b/docs/tutorials/wiki2/src/models/tutorial/models/meta.py @@ -5,7 +5,7 @@ from sqlalchemy.schema import MetaData # providers will autogenerate vastly different names making migrations more # difficult. See: http://alembic.zzzcomputing.com/en/latest/naming.html NAMING_CONVENTION = { - "ix": 'ix_%(column_0_label)s', + "ix": "ix_%(column_0_label)s", "uq": "uq_%(table_name)s_%(column_0_name)s", "ck": "ck_%(table_name)s_%(constraint_name)s", "fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s", diff --git a/docs/tutorials/wiki2/src/models/tutorial/templates/layout.jinja2 b/docs/tutorials/wiki2/src/models/tutorial/templates/layout.jinja2 index 1f658c834..6ce99d08e 100644 --- a/docs/tutorials/wiki2/src/models/tutorial/templates/layout.jinja2 +++ b/docs/tutorials/wiki2/src/models/tutorial/templates/layout.jinja2 @@ -11,15 +11,15 @@ <title>Cookiecutter Alchemy project for the Pyramid Web Framework</title> <!-- Bootstrap core CSS --> - <link href="//oss.maxcdn.com/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet"> + <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <!-- Custom styles for this scaffold --> <link href="{{request.static_url('tutorial:static/theme.css')}}" rel="stylesheet"> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> - <script src="//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> - <script src="//oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script> + <script src="//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js" integrity="sha384-0s5Pv64cNZJieYFkXYOTId2HMA2Lfb6q2nAcx2n0RTLUnCAoTTsS0nKEO27XyKcY" crossorigin="anonymous"></script> + <script src="//oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js" integrity="sha384-ZoaMbDF+4LeFxg6WdScQ9nnR1QC2MIRxA1O9KWEXQwns1G8UNyIEZIQidzb0T1fo" crossorigin="anonymous"></script> <![endif]--> </head> @@ -42,7 +42,7 @@ <ul> <li><i class="glyphicon glyphicon-cog icon-muted"></i><a href="https://github.com/Pylons/pyramid">Github Project</a></li> <li><i class="glyphicon glyphicon-globe icon-muted"></i><a href="https://webchat.freenode.net/?channels=pyramid">IRC Channel</a></li> - <li><i class="glyphicon glyphicon-home icon-muted"></i><a href="http://pylonsproject.org">Pylons Project</a></li> + <li><i class="glyphicon glyphicon-home icon-muted"></i><a href="https://pylonsproject.org">Pylons Project</a></li> </ul> </div> </div> @@ -58,7 +58,7 @@ <!-- Bootstrap core JavaScript ================================================== --> <!-- Placed at the end of the document so the pages load faster --> - <script src="//oss.maxcdn.com/libs/jquery/1.10.2/jquery.min.js"></script> - <script src="//oss.maxcdn.com/libs/twitter-bootstrap/3.0.3/js/bootstrap.min.js"></script> + <script src="//code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script> + <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> </body> </html> diff --git a/docs/tutorials/wiki2/src/models/tutorial/templates/mytemplate.jinja2 b/docs/tutorials/wiki2/src/models/tutorial/templates/mytemplate.jinja2 index 359f55ffa..26d72c0a6 100644 --- a/docs/tutorials/wiki2/src/models/tutorial/templates/mytemplate.jinja2 +++ b/docs/tutorials/wiki2/src/models/tutorial/templates/mytemplate.jinja2 @@ -3,6 +3,6 @@ {% block content %} <div class="content"> <h1><span class="font-semi-bold">Pyramid</span> <span class="smaller">Alchemy project</span></h1> - <p class="lead">Welcome to <span class="font-normal">myproj</span>, a Pyramid application generated by<br><span class="font-normal">Cookiecutter</span>.</p> + <p class="lead">Welcome to <span class="font-normal">{{project}}</span>, a Pyramid application generated by<br><span class="font-normal">Cookiecutter</span>.</p> </div> {% endblock content %} |
