From caee6c5c6125013e638cd38db5916c67fd0e7f26 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 25 Dec 2016 04:38:42 -0800 Subject: quick_tutorial/requirements - add prompt --- docs/quick_tutorial/requirements.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/quick_tutorial/requirements.rst b/docs/quick_tutorial/requirements.rst index 913e08a62..f95dac488 100644 --- a/docs/quick_tutorial/requirements.rst +++ b/docs/quick_tutorial/requirements.rst @@ -172,7 +172,7 @@ time of its release. .. code-block:: bash # Mac and Linux - $VENV/bin/pip install --upgrade pip setuptools + $ $VENV/bin/pip install --upgrade pip setuptools .. code-block:: doscon -- cgit v1.2.3 From 910b8a085085fae3d8b44bca6f037fc61d4b10d0 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 25 Dec 2016 04:46:25 -0800 Subject: quick_tutorial/tutorial_approach - Fix up the process description to reflect reality --- docs/quick_tutorial/tutorial_approach.rst | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'docs') diff --git a/docs/quick_tutorial/tutorial_approach.rst b/docs/quick_tutorial/tutorial_approach.rst index 49a6bfd85..d944aaebd 100644 --- a/docs/quick_tutorial/tutorial_approach.rst +++ b/docs/quick_tutorial/tutorial_approach.rst @@ -10,18 +10,17 @@ Details, references, and deeper discussions are mentioned in "See also" notes. This "Getting Started" tutorial is broken into independent steps, starting with the smallest possible "single file WSGI app" example. Each of these steps introduce a topic and a very small set of concepts via working code. The steps -each correspond to a directory in this repo, where each step/topic/directory is +each correspond to a directory in this repository, where each step's directory is a Python package. -To successfully run each step: +To successfully run each step, you'll usually copy the current step's directory to a new directory, change your working directory to the new directory, then install your project: .. code-block:: bash - $ cd request_response + $ cd ..; cp -r package ini; cd ini $ $VENV/bin/pip install -e . -...and repeat for each step you would like to work on. In most cases we will -start with the results of an earlier step. +For a few steps, you won't copy the step's directory. Directory tree ============== @@ -43,5 +42,5 @@ below: Each of the first-level directories (e.g., ``request_response``) is a *Python project* (except as noted for the ``hello_world`` step). The ``tutorial`` -directory is a *Python package*. At the end of each step, we copy a previous +directory is a *Python package*. At the start of each step, we usually copy a previous directory into a new directory to use as a starting point. -- cgit v1.2.3 From b00c4e46cafbaefa32288480477005caabf88bc9 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Mon, 26 Dec 2016 23:09:42 -0800 Subject: quick_tutorial/tutorial_approach - Fix up the process description to reflect reality, and improve flow --- docs/quick_tutorial/tutorial_approach.rst | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'docs') diff --git a/docs/quick_tutorial/tutorial_approach.rst b/docs/quick_tutorial/tutorial_approach.rst index d944aaebd..8da9f71b3 100644 --- a/docs/quick_tutorial/tutorial_approach.rst +++ b/docs/quick_tutorial/tutorial_approach.rst @@ -7,24 +7,16 @@ Details, references, and deeper discussions are mentioned in "See also" notes. .. seealso:: This is an example "See also" note. -This "Getting Started" tutorial is broken into independent steps, starting with -the smallest possible "single file WSGI app" example. Each of these steps -introduce a topic and a very small set of concepts via working code. The steps -each correspond to a directory in this repository, where each step's directory is -a Python package. - -To successfully run each step, you'll usually copy the current step's directory to a new directory, change your working directory to the new directory, then install your project: - -.. code-block:: bash - - $ cd ..; cp -r package ini; cd ini - $ $VENV/bin/pip install -e . - -For a few steps, you won't copy the step's directory. Directory tree ============== +This "Getting Started" tutorial is broken into independent steps, starting with +the smallest possible "single file WSGI app" example. Each of these steps +introduces a topic and a very small set of concepts via working code. The steps +each correspond to a directory in our workspace, where each step's directory is +a Python package. + As we develop our tutorial, our directory tree will resemble the structure below: @@ -40,7 +32,15 @@ below: │── development.ini `── setup.py -Each of the first-level directories (e.g., ``request_response``) is a *Python +Each of the directories in our ``quick_tutorial`` workspace (e.g., ``request_response``) is a *Python project* (except as noted for the ``hello_world`` step). The ``tutorial`` -directory is a *Python package*. At the start of each step, we usually copy a previous -directory into a new directory to use as a starting point. +directory is a *Python package*. + +For most steps you will copy the previous step's directory to a new directory, and change your working directory to the new directory, then install your project: + +.. code-block:: bash + + $ cd ..; cp -r package ini; cd ini + $ $VENV/bin/pip install -e . + +For a few steps, you won't copy the previous step's directory, but you will still need to install your project with ``$VENV/bin/pip install -e .``. -- cgit v1.2.3 From 558f3e772a1416ebdd9cd8122c0aeac3f0b0d72c Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Mon, 26 Dec 2016 23:11:28 -0800 Subject: quick_tutorial/cookiecutters - renamed from scaffolds - rewrite for use of cookiecutters instead of scaffolds - update source files --- docs/quick_tutorial/cookiecutters.rst | 79 +++++ docs/quick_tutorial/cookiecutters/.coveragerc | 3 + docs/quick_tutorial/cookiecutters/CHANGES.txt | 4 + docs/quick_tutorial/cookiecutters/MANIFEST.in | 2 + docs/quick_tutorial/cookiecutters/README.txt | 29 ++ .../cookiecutters/cc_starter/__init__.py | 12 + .../cc_starter/static/pyramid-16x16.png | Bin 0 -> 1319 bytes .../cookiecutters/cc_starter/static/pyramid.png | Bin 0 -> 12901 bytes .../cookiecutters/cc_starter/static/theme.css | 154 +++++++++ .../cc_starter/templates/layout.jinja2 | 64 ++++ .../cc_starter/templates/mytemplate.jinja2 | 8 + .../cookiecutters/cc_starter/tests.py | 29 ++ .../cookiecutters/cc_starter/views.py | 6 + docs/quick_tutorial/cookiecutters/development.ini | 59 ++++ docs/quick_tutorial/cookiecutters/production.ini | 53 +++ docs/quick_tutorial/cookiecutters/pytest.ini | 3 + docs/quick_tutorial/cookiecutters/setup.py | 51 +++ docs/quick_tutorial/index.rst | 2 +- docs/quick_tutorial/scaffolds.rst | 87 ----- docs/quick_tutorial/scaffolds/CHANGES.txt | 4 - docs/quick_tutorial/scaffolds/MANIFEST.in | 2 - docs/quick_tutorial/scaffolds/README.txt | 1 - docs/quick_tutorial/scaffolds/development.ini | 59 ---- docs/quick_tutorial/scaffolds/production.ini | 53 --- .../quick_tutorial/scaffolds/scaffolds/__init__.py | 12 - .../scaffolds/scaffolds/static/favicon.ico | Bin 1406 -> 0 bytes .../scaffolds/scaffolds/static/footerbg.png | Bin 333 -> 0 bytes .../scaffolds/scaffolds/static/headerbg.png | Bin 203 -> 0 bytes .../scaffolds/scaffolds/static/ie6.css | 8 - .../scaffolds/scaffolds/static/middlebg.png | Bin 2797 -> 0 bytes .../scaffolds/scaffolds/static/pylons.css | 372 --------------------- .../scaffolds/scaffolds/static/pyramid-small.png | Bin 7044 -> 0 bytes .../scaffolds/scaffolds/static/pyramid.png | Bin 33055 -> 0 bytes .../scaffolds/scaffolds/static/transparent.gif | Bin 49 -> 0 bytes .../scaffolds/scaffolds/templates/mytemplate.pt | 73 ---- docs/quick_tutorial/scaffolds/scaffolds/tests.py | 17 - docs/quick_tutorial/scaffolds/scaffolds/views.py | 6 - docs/quick_tutorial/scaffolds/setup.py | 42 --- 38 files changed, 557 insertions(+), 737 deletions(-) create mode 100644 docs/quick_tutorial/cookiecutters.rst create mode 100644 docs/quick_tutorial/cookiecutters/.coveragerc create mode 100644 docs/quick_tutorial/cookiecutters/CHANGES.txt create mode 100644 docs/quick_tutorial/cookiecutters/MANIFEST.in create mode 100644 docs/quick_tutorial/cookiecutters/README.txt create mode 100644 docs/quick_tutorial/cookiecutters/cc_starter/__init__.py create mode 100644 docs/quick_tutorial/cookiecutters/cc_starter/static/pyramid-16x16.png create mode 100644 docs/quick_tutorial/cookiecutters/cc_starter/static/pyramid.png create mode 100644 docs/quick_tutorial/cookiecutters/cc_starter/static/theme.css create mode 100644 docs/quick_tutorial/cookiecutters/cc_starter/templates/layout.jinja2 create mode 100644 docs/quick_tutorial/cookiecutters/cc_starter/templates/mytemplate.jinja2 create mode 100644 docs/quick_tutorial/cookiecutters/cc_starter/tests.py create mode 100644 docs/quick_tutorial/cookiecutters/cc_starter/views.py create mode 100644 docs/quick_tutorial/cookiecutters/development.ini create mode 100644 docs/quick_tutorial/cookiecutters/production.ini create mode 100644 docs/quick_tutorial/cookiecutters/pytest.ini create mode 100644 docs/quick_tutorial/cookiecutters/setup.py delete mode 100644 docs/quick_tutorial/scaffolds.rst delete mode 100644 docs/quick_tutorial/scaffolds/CHANGES.txt delete mode 100644 docs/quick_tutorial/scaffolds/MANIFEST.in delete mode 100644 docs/quick_tutorial/scaffolds/README.txt delete mode 100644 docs/quick_tutorial/scaffolds/development.ini delete mode 100644 docs/quick_tutorial/scaffolds/production.ini delete mode 100644 docs/quick_tutorial/scaffolds/scaffolds/__init__.py delete mode 100644 docs/quick_tutorial/scaffolds/scaffolds/static/favicon.ico delete mode 100644 docs/quick_tutorial/scaffolds/scaffolds/static/footerbg.png delete mode 100644 docs/quick_tutorial/scaffolds/scaffolds/static/headerbg.png delete mode 100644 docs/quick_tutorial/scaffolds/scaffolds/static/ie6.css delete mode 100644 docs/quick_tutorial/scaffolds/scaffolds/static/middlebg.png delete mode 100644 docs/quick_tutorial/scaffolds/scaffolds/static/pylons.css delete mode 100644 docs/quick_tutorial/scaffolds/scaffolds/static/pyramid-small.png delete mode 100644 docs/quick_tutorial/scaffolds/scaffolds/static/pyramid.png delete mode 100644 docs/quick_tutorial/scaffolds/scaffolds/static/transparent.gif delete mode 100644 docs/quick_tutorial/scaffolds/scaffolds/templates/mytemplate.pt delete mode 100644 docs/quick_tutorial/scaffolds/scaffolds/tests.py delete mode 100644 docs/quick_tutorial/scaffolds/scaffolds/views.py delete mode 100644 docs/quick_tutorial/scaffolds/setup.py (limited to 'docs') diff --git a/docs/quick_tutorial/cookiecutters.rst b/docs/quick_tutorial/cookiecutters.rst new file mode 100644 index 000000000..8e7048f78 --- /dev/null +++ b/docs/quick_tutorial/cookiecutters.rst @@ -0,0 +1,79 @@ +.. _qtut_cookiecutters: + +================================================= +Prelude: Quick Project Startup with Cookiecutters +================================================= + +To ease the process of getting started on a project, the Pylons Project provides :term:`cookiecutter`\ s that generate sample :app:`Pyramid` projects from project templates. These cookiecutters will install :app:`Pyramid` and its dependencies as well. We will still cover many topics of web application development using :app:`Pyramid`, but it's good to know of this facility. This prelude will demonstrate how to get a working :app:`Pyramid` web application running via ``cookiecutter``. + + +Objectives +========== + +- Use a cookiecutter to make a new project. + +- Start up a :app:`Pyramid` application and visit it in a web browser. + + +Steps +===== + +#. Install cookiecutter into your virtual environment. + + .. code-block:: bash + + $VENV/bin/pip install cookiecutter + +#. Let's use the cookiecutter ``pyramid-cookiecutter-starter`` to create a starter :app:`Pyramid` project in the current directory, entering values at the prompts as shown below for the following command. + + .. code-block:: bash + + $ $VENV/bin/cookiecutter https://github.com/Pylons/pyramid-cookiecutter-starter + + If prompted for the first item, accept the default ``yes`` by hitting return. + + #. ``You've cloned ~/.cookiecutters/pyramid-cookiecutter-starter before. Is it okay to delete and re-clone it? [yes]:`` + #. ``project_name [Pyramid Scaffold]: cc_starter`` + #. ``repo_name [scaffold]: cc_starter`` + +#. We then run through the following commands. + + .. code-block:: bash + + # Change directory into your newly created project. + $ cd cc_starter + # Create a new virtual environment... + $ python3 -m venv env + # ...where we upgrade packaging tools... + $ env/bin/pip install --upgrade pip setuptools + # ...and into which we install our project. + $ env/bin/pip install -e . + +#. Start up the application by pointing :app:`Pyramid`'s ``pserve`` command at the + project's (generated) configuration file: + + .. code-block:: bash + + $ env/bin/pserve development.ini --reload + + On start up, ``pserve`` logs some output: + + .. code-block:: text + + Starting subprocess with file monitor + Starting server in PID 73732. + Serving on http://localhost:6543 + Serving on http://localhost:6543 + +#. Open http://localhost:6543/ in your browser. + +Analysis +======== + +Rather than starting from scratch, a cookiecutter can make it easy to get a Python +project containing a working :app:`Pyramid` application. The Pylons Project provides `several cookiecutters `_. + +``pserve`` is :app:`Pyramid`'s application runner, separating operational details from +your code. When you install :app:`Pyramid`, a small command program called ``pserve`` +is written to your ``bin`` directory. This program is an executable Python +module. It is passed a configuration file (in this case, ``development.ini``). diff --git a/docs/quick_tutorial/cookiecutters/.coveragerc b/docs/quick_tutorial/cookiecutters/.coveragerc new file mode 100644 index 000000000..1bcbb8c3e --- /dev/null +++ b/docs/quick_tutorial/cookiecutters/.coveragerc @@ -0,0 +1,3 @@ +[run] +source = cc_starter +omit = cc_starter/test* diff --git a/docs/quick_tutorial/cookiecutters/CHANGES.txt b/docs/quick_tutorial/cookiecutters/CHANGES.txt new file mode 100644 index 000000000..14b902fd1 --- /dev/null +++ b/docs/quick_tutorial/cookiecutters/CHANGES.txt @@ -0,0 +1,4 @@ +0.0 +--- + +- Initial version. diff --git a/docs/quick_tutorial/cookiecutters/MANIFEST.in b/docs/quick_tutorial/cookiecutters/MANIFEST.in new file mode 100644 index 000000000..79c7ec16c --- /dev/null +++ b/docs/quick_tutorial/cookiecutters/MANIFEST.in @@ -0,0 +1,2 @@ +include *.txt *.ini *.cfg *.rst +recursive-include cc_starter *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.jinja2 diff --git a/docs/quick_tutorial/cookiecutters/README.txt b/docs/quick_tutorial/cookiecutters/README.txt new file mode 100644 index 000000000..4b1f31bf3 --- /dev/null +++ b/docs/quick_tutorial/cookiecutters/README.txt @@ -0,0 +1,29 @@ +cc_starter +=============================== + +Getting Started +--------------- + +- Change directory into your newly created project. + + cd cc_starter + +- Create a Python virtual environment. + + python3 -m venv env + +- Upgrade packaging tools. + + env/bin/pip install --upgrade pip setuptools + +- Install the project in editable mode with its testing requirements. + + env/bin/pip install -e ".[testing]" + +- Run your project's tests. + + env/bin/pytest + +- Run your project. + + env/bin/pserve development.ini diff --git a/docs/quick_tutorial/cookiecutters/cc_starter/__init__.py b/docs/quick_tutorial/cookiecutters/cc_starter/__init__.py new file mode 100644 index 000000000..49dde36d4 --- /dev/null +++ b/docs/quick_tutorial/cookiecutters/cc_starter/__init__.py @@ -0,0 +1,12 @@ +from pyramid.config import Configurator + + +def main(global_config, **settings): + """ This function returns a Pyramid WSGI application. + """ + config = Configurator(settings=settings) + config.include('pyramid_jinja2') + config.add_static_view('static', 'static', cache_max_age=3600) + config.add_route('home', '/') + config.scan() + return config.make_wsgi_app() diff --git a/docs/quick_tutorial/cookiecutters/cc_starter/static/pyramid-16x16.png b/docs/quick_tutorial/cookiecutters/cc_starter/static/pyramid-16x16.png new file mode 100644 index 000000000..979203112 Binary files /dev/null and b/docs/quick_tutorial/cookiecutters/cc_starter/static/pyramid-16x16.png differ diff --git a/docs/quick_tutorial/cookiecutters/cc_starter/static/pyramid.png b/docs/quick_tutorial/cookiecutters/cc_starter/static/pyramid.png new file mode 100644 index 000000000..4ab837be9 Binary files /dev/null and b/docs/quick_tutorial/cookiecutters/cc_starter/static/pyramid.png differ diff --git a/docs/quick_tutorial/cookiecutters/cc_starter/static/theme.css b/docs/quick_tutorial/cookiecutters/cc_starter/static/theme.css new file mode 100644 index 000000000..0f4b1a4d4 --- /dev/null +++ b/docs/quick_tutorial/cookiecutters/cc_starter/static/theme.css @@ -0,0 +1,154 @@ +@import url(//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700); +body { + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-weight: 300; + color: #ffffff; + background: #bc2131; +} +h1, +h2, +h3, +h4, +h5, +h6 { + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-weight: 300; +} +p { + font-weight: 300; +} +.font-normal { + font-weight: 400; +} +.font-semi-bold { + font-weight: 600; +} +.font-bold { + font-weight: 700; +} +.starter-template { + margin-top: 250px; +} +.starter-template .content { + margin-left: 10px; +} +.starter-template .content h1 { + margin-top: 10px; + font-size: 60px; +} +.starter-template .content h1 .smaller { + font-size: 40px; + color: #f2b7bd; +} +.starter-template .content .lead { + font-size: 25px; + color: #f2b7bd; +} +.starter-template .content .lead .font-normal { + color: #ffffff; +} +.starter-template .links { + float: right; + right: 0; + margin-top: 125px; +} +.starter-template .links ul { + display: block; + padding: 0; + margin: 0; +} +.starter-template .links ul li { + list-style: none; + display: inline; + margin: 0 10px; +} +.starter-template .links ul li:first-child { + margin-left: 0; +} +.starter-template .links ul li:last-child { + margin-right: 0; +} +.starter-template .links ul li.current-version { + color: #f2b7bd; + font-weight: 400; +} +.starter-template .links ul li a, a { + color: #f2b7bd; + text-decoration: underline; +} +.starter-template .links ul li a:hover, a:hover { + color: #ffffff; + text-decoration: underline; +} +.starter-template .links ul li .icon-muted { + color: #eb8b95; + margin-right: 5px; +} +.starter-template .links ul li:hover .icon-muted { + color: #ffffff; +} +.starter-template .copyright { + margin-top: 10px; + font-size: 0.9em; + color: #f2b7bd; + text-transform: lowercase; + float: right; + right: 0; +} +@media (max-width: 1199px) { + .starter-template .content h1 { + font-size: 45px; + } + .starter-template .content h1 .smaller { + font-size: 30px; + } + .starter-template .content .lead { + font-size: 20px; + } +} +@media (max-width: 991px) { + .starter-template { + margin-top: 0; + } + .starter-template .logo { + margin: 40px auto; + } + .starter-template .content { + margin-left: 0; + text-align: center; + } + .starter-template .content h1 { + margin-bottom: 20px; + } + .starter-template .links { + float: none; + text-align: center; + margin-top: 60px; + } + .starter-template .copyright { + float: none; + text-align: center; + } +} +@media (max-width: 767px) { + .starter-template .content h1 .smaller { + font-size: 25px; + display: block; + } + .starter-template .content .lead { + font-size: 16px; + } + .starter-template .links { + margin-top: 40px; + } + .starter-template .links ul li { + display: block; + margin: 0; + } + .starter-template .links ul li .icon-muted { + display: none; + } + .starter-template .copyright { + margin-top: 20px; + } +} diff --git a/docs/quick_tutorial/cookiecutters/cc_starter/templates/layout.jinja2 b/docs/quick_tutorial/cookiecutters/cc_starter/templates/layout.jinja2 new file mode 100644 index 000000000..20da74879 --- /dev/null +++ b/docs/quick_tutorial/cookiecutters/cc_starter/templates/layout.jinja2 @@ -0,0 +1,64 @@ + + + + + + + + + + + Cookiecutter Starter project for the Pyramid Web Framework + + + + + + + + + + + + + +
+
+
+
+ +
+
+ {% block content %} +

No content

+ {% endblock content %} +
+
+ +
+ +
+
+
+ + + + + + + + diff --git a/docs/quick_tutorial/cookiecutters/cc_starter/templates/mytemplate.jinja2 b/docs/quick_tutorial/cookiecutters/cc_starter/templates/mytemplate.jinja2 new file mode 100644 index 000000000..979ee5071 --- /dev/null +++ b/docs/quick_tutorial/cookiecutters/cc_starter/templates/mytemplate.jinja2 @@ -0,0 +1,8 @@ +{% extends "layout.jinja2" %} + +{% block content %} +
+

Pyramid Starter project

+

Welcome to cc_starter, a Pyramid application generated by
Cookiecutter.

+
+{% endblock content %} diff --git a/docs/quick_tutorial/cookiecutters/cc_starter/tests.py b/docs/quick_tutorial/cookiecutters/cc_starter/tests.py new file mode 100644 index 000000000..2f553bbb4 --- /dev/null +++ b/docs/quick_tutorial/cookiecutters/cc_starter/tests.py @@ -0,0 +1,29 @@ +import unittest + +from pyramid import testing + + +class ViewTests(unittest.TestCase): + def setUp(self): + self.config = testing.setUp() + + def tearDown(self): + testing.tearDown() + + def test_my_view(self): + from .views import my_view + request = testing.DummyRequest() + info = my_view(request) + self.assertEqual(info['project'], 'cc_starter') + + +class FunctionalTests(unittest.TestCase): + def setUp(self): + from cc_starter import main + app = main({}) + from webtest import TestApp + self.testapp = TestApp(app) + + def test_root(self): + res = self.testapp.get('/', status=200) + self.assertTrue(b'Pyramid' in res.body) diff --git a/docs/quick_tutorial/cookiecutters/cc_starter/views.py b/docs/quick_tutorial/cookiecutters/cc_starter/views.py new file mode 100644 index 000000000..deedd53b8 --- /dev/null +++ b/docs/quick_tutorial/cookiecutters/cc_starter/views.py @@ -0,0 +1,6 @@ +from pyramid.view import view_config + + +@view_config(route_name='home', renderer='templates/mytemplate.jinja2') +def my_view(request): + return {'project': 'cc_starter'} diff --git a/docs/quick_tutorial/cookiecutters/development.ini b/docs/quick_tutorial/cookiecutters/development.ini new file mode 100644 index 000000000..86b54b51d --- /dev/null +++ b/docs/quick_tutorial/cookiecutters/development.ini @@ -0,0 +1,59 @@ +### +# app configuration +# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html +### + +[app:main] +use = egg:cc_starter + +pyramid.reload_templates = true +pyramid.debug_authorization = false +pyramid.debug_notfound = false +pyramid.debug_routematch = false +pyramid.default_locale_name = en +pyramid.includes = + pyramid_debugtoolbar + +# By default, the toolbar only appears for clients from IP addresses +# '127.0.0.1' and '::1'. +# debugtoolbar.hosts = 127.0.0.1 ::1 + +### +# wsgi server configuration +### + +[server:main] +use = egg:waitress#main +listen = 127.0.0.1:6543 [::1]:6543 + +### +# logging configuration +# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html +### + +[loggers] +keys = root, cc_starter + +[handlers] +keys = console + +[formatters] +keys = generic + +[logger_root] +level = INFO +handlers = console + +[logger_cc_starter] +level = DEBUG +handlers = +qualname = cc_starter + +[handler_console] +class = StreamHandler +args = (sys.stderr,) +level = NOTSET +formatter = generic + +[formatter_generic] +format = %(asctime)s %(levelname)-5.5s [%(name)s:%(lineno)s][%(threadName)s] %(message)s diff --git a/docs/quick_tutorial/cookiecutters/production.ini b/docs/quick_tutorial/cookiecutters/production.ini new file mode 100644 index 000000000..e24a065b1 --- /dev/null +++ b/docs/quick_tutorial/cookiecutters/production.ini @@ -0,0 +1,53 @@ +### +# app configuration +# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html +### + +[app:main] +use = egg:cc_starter + +pyramid.reload_templates = false +pyramid.debug_authorization = false +pyramid.debug_notfound = false +pyramid.debug_routematch = false +pyramid.default_locale_name = en + +### +# wsgi server configuration +### + +[server:main] +use = egg:waitress#main +listen = *:6543 + +### +# logging configuration +# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html +### + +[loggers] +keys = root, cc_starter + +[handlers] +keys = console + +[formatters] +keys = generic + +[logger_root] +level = WARN +handlers = console + +[logger_cc_starter] +level = WARN +handlers = +qualname = cc_starter + +[handler_console] +class = StreamHandler +args = (sys.stderr,) +level = NOTSET +formatter = generic + +[formatter_generic] +format = %(asctime)s %(levelname)-5.5s [%(name)s:%(lineno)s][%(threadName)s] %(message)s diff --git a/docs/quick_tutorial/cookiecutters/pytest.ini b/docs/quick_tutorial/cookiecutters/pytest.ini new file mode 100644 index 000000000..a7bd797f0 --- /dev/null +++ b/docs/quick_tutorial/cookiecutters/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +testpaths = cc_starter +python_files = *.py diff --git a/docs/quick_tutorial/cookiecutters/setup.py b/docs/quick_tutorial/cookiecutters/setup.py new file mode 100644 index 000000000..e47cdf8ea --- /dev/null +++ b/docs/quick_tutorial/cookiecutters/setup.py @@ -0,0 +1,51 @@ +import os + +from setuptools import setup, find_packages + +here = os.path.abspath(os.path.dirname(__file__)) +with open(os.path.join(here, 'README.txt')) as f: + README = f.read() +with open(os.path.join(here, 'CHANGES.txt')) as f: + CHANGES = f.read() + +requires = [ + 'pyramid', + 'pyramid_jinja2', + 'pyramid_debugtoolbar', + 'waitress', +] + +tests_require = [ + 'WebTest >= 1.3.1', # py3 compat + 'pytest', + 'pytest-cov', +] + +setup( + name='cc_starter', + version='0.0', + description='cc_starter', + long_description=README + '\n\n' + CHANGES, + classifiers=[ + 'Programming Language :: Python', + 'Framework :: Pyramid', + 'Topic :: Internet :: WWW/HTTP', + 'Topic :: Internet :: WWW/HTTP :: WSGI :: Application', + ], + author='', + author_email='', + url='', + keywords='web pyramid pylons', + packages=find_packages(), + include_package_data=True, + zip_safe=False, + extras_require={ + 'testing': tests_require, + }, + install_requires=requires, + entry_points={ + 'paste.app_factory': [ + 'main = cc_starter:main', + ], + }, +) diff --git a/docs/quick_tutorial/index.rst b/docs/quick_tutorial/index.rst index 29b4d8fb7..b5b7b3313 100644 --- a/docs/quick_tutorial/index.rst +++ b/docs/quick_tutorial/index.rst @@ -19,7 +19,7 @@ Contents requirements tutorial_approach - scaffolds + cookiecutters hello_world package ini diff --git a/docs/quick_tutorial/scaffolds.rst b/docs/quick_tutorial/scaffolds.rst deleted file mode 100644 index 8712d64e9..000000000 --- a/docs/quick_tutorial/scaffolds.rst +++ /dev/null @@ -1,87 +0,0 @@ -.. _qtut_cookiecutters: - -============================================= -Prelude: Quick Project Startup with Scaffolds -============================================= - -To ease the process of getting started, Pyramid provides *scaffolds* that -generate sample projects from templates in Pyramid and Pyramid add-ons. - - -Background -========== - -We're going to cover a lot in this tutorial, focusing on one topic at a time -and writing everything from scratch. As a warm up, though, it sure would be -nice to see some pixels on a screen. - -Like other web development frameworks, Pyramid provides a number of "scaffolds" -that generate working Python, template, and CSS code for sample applications. -In this step we'll use a built-in scaffold to let us preview a Pyramid -application, before starting from scratch on Step 1. - - -Objectives -========== - -- Use Pyramid's ``pcreate`` command to list scaffolds and make a new project. - -- Start up a Pyramid application and visit it in a web browser. - - -Steps -===== - -#. Pyramid's ``pcreate`` command can list the available scaffolds: - - .. code-block:: bash - - $ $VENV/bin/pcreate --list - Available scaffolds: - alchemy: Pyramid project using SQLAlchemy, SQLite, URL dispatch, and Jinja2 - starter: Pyramid starter project using URL dispatch and Chameleon - zodb: Pyramid project using ZODB, traversal, and Chameleon - -#. Tell ``pcreate`` to use the ``starter`` scaffold to make our project: - - .. code-block:: bash - - $ $VENV/bin/pcreate --scaffold starter scaffolds - -#. Install our project in editable mode for development in the current - directory: - - .. code-block:: bash - - $ cd scaffolds - $ $VENV/bin/pip install -e . - -#. Start up the application by pointing Pyramid's ``pserve`` command at the - project's (generated) configuration file: - - .. code-block:: bash - - $ $VENV/bin/pserve development.ini --reload - - On start up, ``pserve`` logs some output: - - .. code-block:: bash - - Starting subprocess with file monitor - Starting server in PID 72213. - Starting HTTP server on http://0.0.0.0:6543 - -#. Open http://localhost:6543/ in your browser. - -Analysis -======== - -Rather than starting from scratch, ``pcreate`` can make getting a Python -project containing a Pyramid application a quick matter. Pyramid ships with a -few scaffolds. But installing a Pyramid add-on can give you new scaffolds from -that add-on. - -``pserve`` is Pyramid's application runner, separating operational details from -your code. When you install Pyramid, a small command program called ``pserve`` -is written to your ``bin`` directory. This program is an executable Python -module. It is passed a configuration file (in this case, ``development.ini``). diff --git a/docs/quick_tutorial/scaffolds/CHANGES.txt b/docs/quick_tutorial/scaffolds/CHANGES.txt deleted file mode 100644 index 35a34f332..000000000 --- a/docs/quick_tutorial/scaffolds/CHANGES.txt +++ /dev/null @@ -1,4 +0,0 @@ -0.0 ---- - -- Initial version diff --git a/docs/quick_tutorial/scaffolds/MANIFEST.in b/docs/quick_tutorial/scaffolds/MANIFEST.in deleted file mode 100644 index 91d3f763b..000000000 --- a/docs/quick_tutorial/scaffolds/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -include *.txt *.ini *.cfg *.rst -recursive-include scaffolds *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml diff --git a/docs/quick_tutorial/scaffolds/README.txt b/docs/quick_tutorial/scaffolds/README.txt deleted file mode 100644 index 7776dd2d5..000000000 --- a/docs/quick_tutorial/scaffolds/README.txt +++ /dev/null @@ -1 +0,0 @@ -scaffolds README diff --git a/docs/quick_tutorial/scaffolds/development.ini b/docs/quick_tutorial/scaffolds/development.ini deleted file mode 100644 index 0f562d0e1..000000000 --- a/docs/quick_tutorial/scaffolds/development.ini +++ /dev/null @@ -1,59 +0,0 @@ -### -# app configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html -### - -[app:main] -use = egg:scaffolds - -pyramid.reload_templates = true -pyramid.debug_authorization = false -pyramid.debug_notfound = false -pyramid.debug_routematch = false -pyramid.default_locale_name = en -pyramid.includes = - pyramid_debugtoolbar - -# By default, the toolbar only appears for clients from IP addresses -# '127.0.0.1' and '::1'. -# debugtoolbar.hosts = 127.0.0.1 ::1 - -### -# wsgi server configuration -### - -[server:main] -use = egg:waitress#main -listen = *:6543 - -### -# logging configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html -### - -[loggers] -keys = root, scaffolds - -[handlers] -keys = console - -[formatters] -keys = generic - -[logger_root] -level = INFO -handlers = console - -[logger_scaffolds] -level = DEBUG -handlers = -qualname = scaffolds - -[handler_console] -class = StreamHandler -args = (sys.stderr,) -level = NOTSET -formatter = generic - -[formatter_generic] -format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s diff --git a/docs/quick_tutorial/scaffolds/production.ini b/docs/quick_tutorial/scaffolds/production.ini deleted file mode 100644 index bf0446a47..000000000 --- a/docs/quick_tutorial/scaffolds/production.ini +++ /dev/null @@ -1,53 +0,0 @@ -### -# app configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html -### - -[app:main] -use = egg:scaffolds - -pyramid.reload_templates = false -pyramid.debug_authorization = false -pyramid.debug_notfound = false -pyramid.debug_routematch = false -pyramid.default_locale_name = en - -### -# wsgi server configuration -### - -[server:main] -use = egg:waitress#main -listen = *:6543 - -### -# logging configuration -# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html -### - -[loggers] -keys = root, scaffolds - -[handlers] -keys = console - -[formatters] -keys = generic - -[logger_root] -level = WARN -handlers = console - -[logger_scaffolds] -level = WARN -handlers = -qualname = scaffolds - -[handler_console] -class = StreamHandler -args = (sys.stderr,) -level = NOTSET -formatter = generic - -[formatter_generic] -format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s diff --git a/docs/quick_tutorial/scaffolds/scaffolds/__init__.py b/docs/quick_tutorial/scaffolds/scaffolds/__init__.py deleted file mode 100644 index ad5ecbc6f..000000000 --- a/docs/quick_tutorial/scaffolds/scaffolds/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -from pyramid.config import Configurator - - -def main(global_config, **settings): - """ This function returns a Pyramid WSGI application. - """ - config = Configurator(settings=settings) - config.include('pyramid_chameleon') - config.add_static_view('static', 'static', cache_max_age=3600) - config.add_route('home', '/') - config.scan() - return config.make_wsgi_app() diff --git a/docs/quick_tutorial/scaffolds/scaffolds/static/favicon.ico b/docs/quick_tutorial/scaffolds/scaffolds/static/favicon.ico deleted file mode 100644 index 71f837c9e..000000000 Binary files a/docs/quick_tutorial/scaffolds/scaffolds/static/favicon.ico and /dev/null differ diff --git a/docs/quick_tutorial/scaffolds/scaffolds/static/footerbg.png b/docs/quick_tutorial/scaffolds/scaffolds/static/footerbg.png deleted file mode 100644 index 1fbc873da..000000000 Binary files a/docs/quick_tutorial/scaffolds/scaffolds/static/footerbg.png and /dev/null differ diff --git a/docs/quick_tutorial/scaffolds/scaffolds/static/headerbg.png b/docs/quick_tutorial/scaffolds/scaffolds/static/headerbg.png deleted file mode 100644 index 0596f2020..000000000 Binary files a/docs/quick_tutorial/scaffolds/scaffolds/static/headerbg.png and /dev/null differ diff --git a/docs/quick_tutorial/scaffolds/scaffolds/static/ie6.css b/docs/quick_tutorial/scaffolds/scaffolds/static/ie6.css deleted file mode 100644 index b7c8493d8..000000000 --- a/docs/quick_tutorial/scaffolds/scaffolds/static/ie6.css +++ /dev/null @@ -1,8 +0,0 @@ -* html img, -* html .png{position:relative;behavior:expression((this.runtimeStyle.behavior="none")&&(this.pngSet?this.pngSet=true:(this.nodeName == "IMG" && this.src.toLowerCase().indexOf('.png')>-1?(this.runtimeStyle.backgroundImage = "none", -this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "',sizingMethod='image')", -this.src = "static/transparent.gif"):(this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().replace('url("','').replace('")',''), -this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.origBg + "',sizingMethod='crop')", -this.runtimeStyle.backgroundImage = "none")),this.pngSet=true) -);} -#wrap{display:table;height:100%} diff --git a/docs/quick_tutorial/scaffolds/scaffolds/static/middlebg.png b/docs/quick_tutorial/scaffolds/scaffolds/static/middlebg.png deleted file mode 100644 index 2369cfb7d..000000000 Binary files a/docs/quick_tutorial/scaffolds/scaffolds/static/middlebg.png and /dev/null differ diff --git a/docs/quick_tutorial/scaffolds/scaffolds/static/pylons.css b/docs/quick_tutorial/scaffolds/scaffolds/static/pylons.css deleted file mode 100644 index 4b1c017cd..000000000 --- a/docs/quick_tutorial/scaffolds/scaffolds/static/pylons.css +++ /dev/null @@ -1,372 +0,0 @@ -html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td -{ - margin: 0; - padding: 0; - border: 0; - outline: 0; - font-size: 100%; /* 16px */ - vertical-align: baseline; - background: transparent; -} - -body -{ - line-height: 1; -} - -ol, ul -{ - list-style: none; -} - -blockquote, q -{ - quotes: none; -} - -blockquote:before, blockquote:after, q:before, q:after -{ - content: ''; - content: none; -} - -:focus -{ - outline: 0; -} - -ins -{ - text-decoration: none; -} - -del -{ - text-decoration: line-through; -} - -table -{ - border-collapse: collapse; - border-spacing: 0; -} - -sub -{ - vertical-align: sub; - font-size: smaller; - line-height: normal; -} - -sup -{ - vertical-align: super; - font-size: smaller; - line-height: normal; -} - -ul, menu, dir -{ - display: block; - list-style-type: disc; - margin: 1em 0; - padding-left: 40px; -} - -ol -{ - display: block; - list-style-type: decimal-leading-zero; - margin: 1em 0; - padding-left: 40px; -} - -li -{ - display: list-item; -} - -ul ul, ul ol, ul dir, ul menu, ul dl, ol ul, ol ol, ol dir, ol menu, ol dl, dir ul, dir ol, dir dir, dir menu, dir dl, menu ul, menu ol, menu dir, menu menu, menu dl, dl ul, dl ol, dl dir, dl menu, dl dl -{ - margin-top: 0; - margin-bottom: 0; -} - -ol ul, ul ul, menu ul, dir ul, ol menu, ul menu, menu menu, dir menu, ol dir, ul dir, menu dir, dir dir -{ - list-style-type: circle; -} - -ol ol ul, ol ul ul, ol menu ul, ol dir ul, ol ol menu, ol ul menu, ol menu menu, ol dir menu, ol ol dir, ol ul dir, ol menu dir, ol dir dir, ul ol ul, ul ul ul, ul menu ul, ul dir ul, ul ol menu, ul ul menu, ul menu menu, ul dir menu, ul ol dir, ul ul dir, ul menu dir, ul dir dir, menu ol ul, menu ul ul, menu menu ul, menu dir ul, menu ol menu, menu ul menu, menu menu menu, menu dir menu, menu ol dir, menu ul dir, menu menu dir, menu dir dir, dir ol ul, dir ul ul, dir menu ul, dir dir ul, dir ol menu, dir ul menu, dir menu menu, dir dir menu, dir ol dir, dir ul dir, dir menu dir, dir dir dir -{ - list-style-type: square; -} - -.hidden -{ - display: none; -} - -p -{ - line-height: 1.5em; -} - -h1 -{ - font-size: 1.75em; - line-height: 1.7em; - font-family: helvetica, verdana; -} - -h2 -{ - font-size: 1.5em; - line-height: 1.7em; - font-family: helvetica, verdana; -} - -h3 -{ - font-size: 1.25em; - line-height: 1.7em; - font-family: helvetica, verdana; -} - -h4 -{ - font-size: 1em; - line-height: 1.7em; - font-family: helvetica, verdana; -} - -html, body -{ - width: 100%; - height: 100%; -} - -body -{ - margin: 0; - padding: 0; - background-color: #fff; - position: relative; - font: 16px/24px NobileRegular, "Lucida Grande", Lucida, Verdana, sans-serif; -} - -a -{ - color: #1b61d6; - text-decoration: none; -} - -a:hover -{ - color: #e88f00; - text-decoration: underline; -} - -body h1, body h2, body h3, body h4, body h5, body h6 -{ - font-family: NeutonRegular, "Lucida Grande", Lucida, Verdana, sans-serif; - font-weight: 400; - color: #373839; - font-style: normal; -} - -#wrap -{ - min-height: 100%; -} - -#header, #footer -{ - width: 100%; - color: #fff; - height: 40px; - position: absolute; - text-align: center; - line-height: 40px; - overflow: hidden; - font-size: 12px; - vertical-align: middle; -} - -#header -{ - background: #000; - top: 0; - font-size: 14px; -} - -#footer -{ - bottom: 0; - background: #000 url(footerbg.png) repeat-x 0 top; - position: relative; - margin-top: -40px; - clear: both; -} - -.header, .footer -{ - width: 750px; - margin-right: auto; - margin-left: auto; -} - -.wrapper -{ - width: 100%; -} - -#top, #top-small, #bottom -{ - width: 100%; -} - -#top -{ - color: #000; - height: 230px; - background: #fff url(headerbg.png) repeat-x 0 top; - position: relative; -} - -#top-small -{ - color: #000; - height: 60px; - background: #fff url(headerbg.png) repeat-x 0 top; - position: relative; -} - -#bottom -{ - color: #222; - background-color: #fff; -} - -.top, .top-small, .middle, .bottom -{ - width: 750px; - margin-right: auto; - margin-left: auto; -} - -.top -{ - padding-top: 40px; -} - -.top-small -{ - padding-top: 10px; -} - -#middle -{ - width: 100%; - height: 100px; - background: url(middlebg.png) repeat-x; - border-top: 2px solid #fff; - border-bottom: 2px solid #b2b2b2; -} - -.app-welcome -{ - margin-top: 25px; -} - -.app-name -{ - color: #000; - font-weight: 700; -} - -.bottom -{ - padding-top: 50px; -} - -#left -{ - width: 350px; - float: left; - padding-right: 25px; -} - -#right -{ - width: 350px; - float: right; - padding-left: 25px; -} - -.align-left -{ - text-align: left; -} - -.align-right -{ - text-align: right; -} - -.align-center -{ - text-align: center; -} - -ul.links -{ - margin: 0; - padding: 0; -} - -ul.links li -{ - list-style-type: none; - font-size: 14px; -} - -form -{ - border-style: none; -} - -fieldset -{ - border-style: none; -} - -input -{ - color: #222; - border: 1px solid #ccc; - font-family: sans-serif; - font-size: 12px; - line-height: 16px; -} - -input[type=text], input[type=password] -{ - width: 205px; -} - -input[type=submit] -{ - background-color: #ddd; - font-weight: 700; -} - -/*Opera Fix*/ -body:before -{ - content: ""; - height: 100%; - float: left; - width: 0; - margin-top: -32767px; -} diff --git a/docs/quick_tutorial/scaffolds/scaffolds/static/pyramid-small.png b/docs/quick_tutorial/scaffolds/scaffolds/static/pyramid-small.png deleted file mode 100644 index a5bc0ade7..000000000 Binary files a/docs/quick_tutorial/scaffolds/scaffolds/static/pyramid-small.png and /dev/null differ diff --git a/docs/quick_tutorial/scaffolds/scaffolds/static/pyramid.png b/docs/quick_tutorial/scaffolds/scaffolds/static/pyramid.png deleted file mode 100644 index 347e05549..000000000 Binary files a/docs/quick_tutorial/scaffolds/scaffolds/static/pyramid.png and /dev/null differ diff --git a/docs/quick_tutorial/scaffolds/scaffolds/static/transparent.gif b/docs/quick_tutorial/scaffolds/scaffolds/static/transparent.gif deleted file mode 100644 index 0341802e5..000000000 Binary files a/docs/quick_tutorial/scaffolds/scaffolds/static/transparent.gif and /dev/null differ diff --git a/docs/quick_tutorial/scaffolds/scaffolds/templates/mytemplate.pt b/docs/quick_tutorial/scaffolds/scaffolds/templates/mytemplate.pt deleted file mode 100644 index b43a174e3..000000000 --- a/docs/quick_tutorial/scaffolds/scaffolds/templates/mytemplate.pt +++ /dev/null @@ -1,73 +0,0 @@ - - - - The Pyramid Web Framework - - - - - - - - - - -
-
-
-
pyramid
-
-
-
-
-

- Welcome to ${project}, an application generated by
- the Pyramid Web Framework. -

-
-
-
-
-
-

Search documentation

-
- - -
-
- -
-
-
- - diff --git a/docs/quick_tutorial/scaffolds/scaffolds/tests.py b/docs/quick_tutorial/scaffolds/scaffolds/tests.py deleted file mode 100644 index 4f906ffa9..000000000 --- a/docs/quick_tutorial/scaffolds/scaffolds/tests.py +++ /dev/null @@ -1,17 +0,0 @@ -import unittest - -from pyramid import testing - - -class ViewTests(unittest.TestCase): - def setUp(self): - self.config = testing.setUp() - - def tearDown(self): - testing.tearDown() - - def test_my_view(self): - from .views import my_view - request = testing.DummyRequest() - info = my_view(request) - self.assertEqual(info['project'], 'scaffolds') diff --git a/docs/quick_tutorial/scaffolds/scaffolds/views.py b/docs/quick_tutorial/scaffolds/scaffolds/views.py deleted file mode 100644 index db90d8364..000000000 --- a/docs/quick_tutorial/scaffolds/scaffolds/views.py +++ /dev/null @@ -1,6 +0,0 @@ -from pyramid.view import view_config - - -@view_config(route_name='home', renderer='templates/mytemplate.pt') -def my_view(request): - return {'project': 'scaffolds'} diff --git a/docs/quick_tutorial/scaffolds/setup.py b/docs/quick_tutorial/scaffolds/setup.py deleted file mode 100644 index ec95946a5..000000000 --- a/docs/quick_tutorial/scaffolds/setup.py +++ /dev/null @@ -1,42 +0,0 @@ -import os - -from setuptools import setup, find_packages - -here = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(here, 'README.txt')) as f: - README = f.read() -with open(os.path.join(here, 'CHANGES.txt')) as f: - CHANGES = f.read() - -requires = [ - 'pyramid', - 'pyramid_chameleon', - 'pyramid_debugtoolbar', - 'waitress', - ] - -setup(name='scaffolds', - version='0.0', - description='scaffolds', - long_description=README + '\n\n' + CHANGES, - classifiers=[ - "Programming Language :: Python", - "Framework :: Pyramid", - "Topic :: Internet :: WWW/HTTP", - "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", - ], - author='', - author_email='', - url='', - keywords='web pyramid pylons', - packages=find_packages(), - include_package_data=True, - zip_safe=False, - install_requires=requires, - tests_require=requires, - test_suite="scaffolds", - entry_points="""\ - [paste.app_factory] - main = scaffolds:main - """, - ) -- cgit v1.2.3 From 99d45a935a4fe6a9e9d1df364e74f536a418e105 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Mon, 26 Dec 2016 23:16:49 -0800 Subject: quick_tutorial/hello_world - minor update for cd into current directory. - modernize "microframework" --- docs/quick_tutorial/hello_world.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/quick_tutorial/hello_world.rst b/docs/quick_tutorial/hello_world.rst index 56dccde58..2f2515fcd 100644 --- a/docs/quick_tutorial/hello_world.rst +++ b/docs/quick_tutorial/hello_world.rst @@ -11,7 +11,7 @@ Python packages, no ``pip install -e .``, no other machinery. Background ========== -Microframeworks are all the rage these days. "Microframework" is a marketing +Microframeworks were all the rage, until the next shiny thing came along. "Microframework" is a marketing term, not a technical one. They have a low mental overhead: they do so little, the only things you have to worry about are *your things*. @@ -49,7 +49,7 @@ Steps .. code-block:: bash - $ mkdir hello_world; cd hello_world + $ cd ~/projects/quick_tutorial; mkdir hello_world; cd hello_world #. Copy the following into ``hello_world/app.py``: -- cgit v1.2.3 From 6261ae4fbf73cb9e72aea2b8f67c6b04e5c474a6 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Mon, 26 Dec 2016 23:59:14 -0800 Subject: narr/cookiecutters - add narr/scaffolding - update index - add link to narr/cookiecutters --- docs/index.rst | 1 + docs/narr/cookiecutters.rst | 20 ++++++++++++++++++++ docs/narr/scaffolding.rst | 4 ++++ 3 files changed, 25 insertions(+) create mode 100644 docs/narr/cookiecutters.rst (limited to 'docs') diff --git a/docs/index.rst b/docs/index.rst index 60dcdcc9c..668347744 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -145,6 +145,7 @@ Narrative documentation in chapter form explaining how to use :app:`Pyramid`. narr/extending narr/advconfig narr/extconfig + narr/cookiecutters narr/scaffolding narr/upgrading narr/threadlocals diff --git a/docs/narr/cookiecutters.rst b/docs/narr/cookiecutters.rst new file mode 100644 index 000000000..bb4c61616 --- /dev/null +++ b/docs/narr/cookiecutters.rst @@ -0,0 +1,20 @@ +.. _cookiecutters: + +Pyramid cookiecutters +===================== + +.. versionadded:: 1.8 + +A :term:`cookiecutter` is a command-line utility that creates projects from :ref:`cookiecutters ` (project templates), e.g., creating a Python package project from a Python package project template. + +Pyramid cookiecutters have replaced the now deprecated Pyramid scaffolds, and should be used going forward. Pyramid cookiecutters released under the Pylons Project include: + +* `pyramid-cookiecutter-alchemy `_ +* `pyramid-cookiecutter-starter `_ +* `pyramid-cookiecutter-zodb `_ + +Development of cookiecutters is documented under `Learn the Basics of Cookiecutter by Creating a Cookiecutter `_. + +.. seealso:: See also `Cookiecutter Features `_. + +.. seealso:: See also :term:`scaffold`. diff --git a/docs/narr/scaffolding.rst b/docs/narr/scaffolding.rst index 164ceb3bf..27239d34e 100644 --- a/docs/narr/scaffolding.rst +++ b/docs/narr/scaffolding.rst @@ -3,6 +3,10 @@ Creating Pyramid Scaffolds ========================== +.. deprecated:: 1.8 + + Scaffolds and the ``pcreate`` script used to generate :app:`Pyramid` projects from scaffolds have been deprecated. Use :ref:`cookiecutters` instead. + You can extend Pyramid by creating a :term:`scaffold` template. A scaffold template is useful if you'd like to distribute a customizable configuration of Pyramid to other users. Once you've created a scaffold, and someone has -- cgit v1.2.3 From f698dd71af8af59d4a18e274189a58ba0f66a7b7 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 27 Dec 2016 00:02:39 -0800 Subject: narr/assets - update --- docs/narr/assets.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/narr/assets.rst b/docs/narr/assets.rst index 58f547fc9..f5a2f9684 100644 --- a/docs/narr/assets.rst +++ b/docs/narr/assets.rst @@ -28,7 +28,7 @@ asset: The use of assets is quite common in most web development projects. For example, when you create a :app:`Pyramid` application using one of the -available scaffolds, as described in :ref:`creating_a_project`, the directory +available :term:`cookiecutter`\ s, as described in :ref:`creating_a_project`, the directory representing the application contains a Python :term:`package`. Within that Python package, there are directories full of files which are static assets. For example, there's a ``static`` directory which contains ``.css``, ``.js``, -- cgit v1.2.3 From b0b2b0772a9e5b5767404a88f9d8da987f9afed4 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 27 Dec 2016 00:03:26 -0800 Subject: narr/extending - update --- docs/narr/extending.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/narr/extending.rst b/docs/narr/extending.rst index 9dc042024..bee30ec1a 100644 --- a/docs/narr/extending.rst +++ b/docs/narr/extending.rst @@ -190,7 +190,7 @@ The general pattern for extending an existing application looks something like this: - Create a new Python package. The easiest way to do this is to create a new - :app:`Pyramid` application using the scaffold mechanism. See + :app:`Pyramid` application using a :term:`cookiecutter`. See :ref:`creating_a_project` for more information. - In the new package, create Python files containing views and other overridden -- cgit v1.2.3 From 6b3f9e5846879e7335c38eaf629500a1f6a97435 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 27 Dec 2016 00:09:35 -0800 Subject: narr/install - update --- docs/narr/install.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/narr/install.rst b/docs/narr/install.rst index c3c2ba64c..10173aec8 100644 --- a/docs/narr/install.rst +++ b/docs/narr/install.rst @@ -260,5 +260,5 @@ What Gets Installed When you install :app:`Pyramid`, various libraries such as WebOb, PasteDeploy, and others are installed. -Additionally, as chronicled in :ref:`project_narr`, scaffolds will be -registered, which make it easy to start a new :app:`Pyramid` project. +Additionally, as chronicled in :ref:`project_narr`, :term:`cookiecutter`\ s will be +used, which make it easy to start a new :app:`Pyramid` project. -- cgit v1.2.3 From 0ff74073d3efc787a6fde1818d05f4aa9227d243 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 27 Dec 2016 00:11:15 -0800 Subject: narr/introduction - update --- docs/narr/introduction.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/narr/introduction.rst b/docs/narr/introduction.rst index adad196e4..7027d6601 100644 --- a/docs/narr/introduction.rst +++ b/docs/narr/introduction.rst @@ -182,7 +182,7 @@ available. Pyramid can automatically utilize changed templates when rendering pages and automatically restart the application to incorporate changed Python code. Plain old ``print()`` calls used for debugging can display to a console. -Pyramid's debug toolbar comes activated when you use a Pyramid scaffold to +Pyramid's debug toolbar comes activated when you use a Pyramid :term:`cookiecutter` to render a project. This toolbar overlays your application in the browser, and allows you access to framework data, such as the routes configured, the last renderings performed, the current set of packages installed, SQLAlchemy queries @@ -494,7 +494,7 @@ Example: :ref:`view_configuration_parameters`. Transaction management ~~~~~~~~~~~~~~~~~~~~~~ -Pyramid's :term:`scaffold` system renders projects that include a *transaction +A couple of Pyramid's :term:`cookiecutter`\ s include a *transaction management* system, stolen from Zope. When you use this transaction management system, you cease being responsible for committing your data anymore. Instead Pyramid takes care of committing: it commits at the end of a request or aborts -- cgit v1.2.3 From 2d35e2fd2d893f580052e8c5840a9238edaecacd Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 27 Dec 2016 00:25:55 -0800 Subject: narr/logging - update --- docs/narr/logging.rst | 106 ++++++++------------------------------------------ 1 file changed, 16 insertions(+), 90 deletions(-) (limited to 'docs') diff --git a/docs/narr/logging.rst b/docs/narr/logging.rst index c7b4b9d6f..f2c990861 100644 --- a/docs/narr/logging.rst +++ b/docs/narr/logging.rst @@ -9,11 +9,11 @@ to send log messages to loggers that you've configured. .. warning:: - This chapter assumes you've used a :term:`scaffold` to create a project + This chapter assumes you've used a :term:`cookiecutter` to create a project which contains ``development.ini`` and ``production.ini`` files which help - configure logging. All of the scaffolds which ship with :app:`Pyramid` do - this. If you're not using a scaffold, or if you've used a third-party - scaffold which does not create these files, the configuration information in + configure logging. All of the Pyramid cookiecutters provided by the Pylons Project do + this. If you're not using a cookiecutter, or if you've used a third-party + cookiecutter which does not create these files, the configuration information in this chapter may not be applicable. .. index: @@ -26,11 +26,11 @@ to send log messages to loggers that you've configured. Logging Configuration --------------------- -A :app:`Pyramid` project created from a :term:`scaffold` is configured to allow +A :app:`Pyramid` project created from a :term:`cookiecutter` is configured to allow you to send messages to :mod:`Python standard library logging package ` loggers from within your application. In particular, the :term:`PasteDeploy` ``development.ini`` and ``production.ini`` files created -when you use a scaffold include a basic configuration for the Python +when you use a cookiecutter include a basic configuration for the Python :mod:`logging` package. PasteDeploy ``.ini`` files use the Python standard library :mod:`ConfigParser @@ -43,94 +43,20 @@ from when you run ``pserve``. The ``pserve`` command calls the :func:`pyramid.paster.setup_logging` function, a thin wrapper around the :func:`logging.config.fileConfig` using the specified ``.ini`` file, if it contains a ``[loggers]`` section (all of the -scaffold-generated ``.ini`` files do). ``setup_logging`` reads the logging +cookiecutter-generated ``.ini`` files do). ``setup_logging`` reads the logging configuration from the ini file upon which ``pserve`` was invoked. Default logging configuration is provided in both the default -``development.ini`` and the ``production.ini`` file. The logging configuration +``development.ini`` and the ``production.ini`` files. If you use ``pyramid-cookiecutter-starter`` to generate a Pyramid project with the name of the package as ``hello_world``, then the logging configuration in the ``development.ini`` file is as follows: -.. code-block:: ini - :linenos: - - # Begin logging configuration - - [loggers] - keys = root, {{package_logger}} - - [handlers] - keys = console - - [formatters] - keys = generic - - [logger_root] - level = INFO - handlers = console - - [logger_{{package_logger}}] - level = DEBUG - handlers = - qualname = {{package}} - - [handler_console] - class = StreamHandler - args = (sys.stderr,) - level = NOTSET - formatter = generic - - [formatter_generic] - format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s - - # End logging configuration +.. literalinclude:: ../quick_tour/package/development.ini + :language: ini + :lineno-match: + :lines: 29- The ``production.ini`` file uses the ``WARN`` level in its logger -configuration, but it is otherwise identical. - -The name ``{{package_logger}}`` above will be replaced with the name of your -project's :term:`package`, which is derived from the name you provide to your -project. For instance, if you do: - -.. code-block:: text - :linenos: - - pcreate -s starter MyApp - -The logging configuration will literally be: - -.. code-block:: ini - :linenos: - - # Begin logging configuration - - [loggers] - keys = root, myapp - - [handlers] - keys = console - - [formatters] - keys = generic - - [logger_root] - level = INFO - handlers = console - - [logger_myapp] - level = DEBUG - handlers = - qualname = myapp - - [handler_console] - class = StreamHandler - args = (sys.stderr,) - level = NOTSET - formatter = generic - - [formatter_generic] - format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s - - # End logging configuration +configuration instead of ``DEBUG``, but it is otherwise identical. In this logging configuration: @@ -149,7 +75,7 @@ that ask for a logger (via ``logging.getLogger``) that has a name which begins with anything except your project's package name (e.g., ``myapp``). The logger with the same name as your package name is reserved for your own usage in your :app:`Pyramid` application. Its existence means that you can log to a known -logging location from any :app:`Pyramid` application generated via a scaffold. +logging location from any :app:`Pyramid` application generated via a cookiecutter. :app:`Pyramid` and many other libraries (such as Beaker, SQLAlchemy, Paste) log a number of messages to the root logger for debugging purposes. Switching the @@ -162,9 +88,9 @@ root logger level to ``DEBUG`` reveals them: level = DEBUG handlers = console -Some scaffolds configure additional loggers for additional subsystems they use +Some cookiecutters configure additional loggers for additional subsystems they use (such as SQLALchemy). Take a look at the ``production.ini`` and -``development.ini`` files rendered when you create a project from a scaffold. +``development.ini`` files rendered when you create a project from a cookiecutter. Sending Logging Messages ------------------------ -- cgit v1.2.3 From 0a11d04513d38f560d0e147eeb7d0c1d9d4ac261 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 27 Dec 2016 00:27:29 -0800 Subject: narr/paste - update --- docs/narr/paste.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/narr/paste.rst b/docs/narr/paste.rst index 0a217e6e3..a3f1b866e 100644 --- a/docs/narr/paste.rst +++ b/docs/narr/paste.rst @@ -3,7 +3,7 @@ PasteDeploy Configuration Files =============================== -Packages generated via a :term:`scaffold` make use of a system created by Ian +Packages generated via a :term:`cookiecutter` make use of a system created by Ian Bicking named :term:`PasteDeploy`. PasteDeploy defines a way to declare :term:`WSGI` application configuration in an ``.ini`` file. @@ -14,7 +14,7 @@ runner ``pserve``, as well as other commands such as ``pviews``, ``pshell``, PasteDeploy is not a particularly integral part of Pyramid. It's possible to create a Pyramid application which does not use PasteDeploy at all. We show a Pyramid application that doesn't use PasteDeploy in :ref:`firstapp_chapter`. -However, all Pyramid scaffolds render PasteDeploy configuration files, to +However, all Pyramid cookiecutters render PasteDeploy configuration files, to provide new developers with a standardized way of setting deployment values, and to provide new users with a standardized way of starting, stopping, and debugging an application. @@ -80,7 +80,7 @@ In English, this entry point can thus be referred to as a "PasteDeploy application factory in the ``MyProject`` project which has the entry point named ``main`` where the entry point refers to a ``main`` function in the ``mypackage`` module". Indeed, if you open up the ``__init__.py`` module -generated within any scaffold-generated package, you'll see a ``main`` +generated within any cookiecutter-generated package, you'll see a ``main`` function. This is the function called by :term:`PasteDeploy` when the ``pserve`` command is invoked against our application. It accepts a global configuration object and *returns* an instance of our application. -- cgit v1.2.3 From e2cda93d7422de50d014bcbacc2f4c31b95508bd Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 27 Dec 2016 00:35:50 -0800 Subject: narr/cookiecutters - revise --- docs/narr/cookiecutters.rst | 8 +++++--- docs/narr/project.rst | 37 ++++++++++++++++++++++++------------- 2 files changed, 29 insertions(+), 16 deletions(-) (limited to 'docs') diff --git a/docs/narr/cookiecutters.rst b/docs/narr/cookiecutters.rst index bb4c61616..abedb25b9 100644 --- a/docs/narr/cookiecutters.rst +++ b/docs/narr/cookiecutters.rst @@ -13,8 +13,10 @@ Pyramid cookiecutters have replaced the now deprecated Pyramid scaffolds, and sh * `pyramid-cookiecutter-starter `_ * `pyramid-cookiecutter-zodb `_ -Development of cookiecutters is documented under `Learn the Basics of Cookiecutter by Creating a Cookiecutter `_. +.. seealso:: -.. seealso:: See also `Cookiecutter Features `_. + See also `Cookiecutter Installation `_ and `Cookiecutter Features `_. Development of cookiecutters is documented under `Learn the Basics of Cookiecutter by Creating a Cookiecutter `_. -.. seealso:: See also :term:`scaffold`. +.. seealso:: + + See also :term:`scaffold`. diff --git a/docs/narr/project.rst b/docs/narr/project.rst index 62c4723df..118a9fa89 100644 --- a/docs/narr/project.rst +++ b/docs/narr/project.rst @@ -5,33 +5,44 @@ Creating a :app:`Pyramid` Project As we saw in :ref:`firstapp_chapter`, it's possible to create a :app:`Pyramid` application completely manually. However, it's usually more convenient to use -a :term:`scaffold` to generate a basic :app:`Pyramid` :term:`project`. +a :term:`cookiecutter` to generate a basic :app:`Pyramid` :term:`project`. A project is a directory that contains at least one Python :term:`package`. -You'll use a scaffold to create a project, and you'll create your application +You'll use a cookiecutter to create a project, and you'll create your application logic within a package that lives inside the project. Even if your application is extremely simple, it is useful to place code that drives the application within a package, because (1) a package is more easily extended with new code, and (2) an application that lives inside a package can also be distributed more easily than one which does not live within a package. -:app:`Pyramid` comes with a variety of scaffolds that you can use to generate a -project. Each scaffold makes different configuration assumptions about what +The Pylons Project provides several :app:`Pyramid` cookiecutters that you can use to generate a +project. Each cookiecutter makes different configuration assumptions about what type of application you're trying to construct. -These scaffolds are rendered using the ``pcreate`` command that is installed as -part of Pyramid. +These cookiecutters are rendered using the ``cookiecutter`` command that you may install. + +.. seealso:: + + + .. index:: - single: scaffolds - single: starter scaffold - single: zodb scaffold - single: alchemy scaffold + single: cookiecutters + single: pyramid-cookiecutter-starter + single: pyramid-cookiecutter-zodb + single: pyramid-cookiecutter-alchemy -.. _additional_paster_scaffolds: +.. _additional_cookiecutters: + +:app:`Pyramid` cookiecutters +---------------------------- + +Pyramid cookiecutters released under the Pylons Project include: + +* `pyramid-cookiecutter-alchemy `_ +* `pyramid-cookiecutter-starter `_ +* `pyramid-cookiecutter-zodb `_ -Scaffolds Included with :app:`Pyramid` --------------------------------------- The convenience scaffolds included with :app:`Pyramid` differ from each other on a number of axes: -- cgit v1.2.3 From e1b26edbb88ab51b1043ef82f093507d987cc2a4 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 27 Dec 2016 02:36:30 -0800 Subject: narr/project - update for cookiecutters - update source files - update project.png - fix literalinclude reference in logging --- docs/narr/MyProject/CHANGES.txt | 4 - docs/narr/MyProject/MANIFEST.in | 2 - docs/narr/MyProject/README.txt | 12 - docs/narr/MyProject/development.ini | 59 ---- docs/narr/MyProject/myproject/__init__.py | 12 - .../MyProject/myproject/static/pyramid-16x16.png | Bin 1319 -> 0 bytes docs/narr/MyProject/myproject/static/pyramid.png | Bin 12901 -> 0 bytes docs/narr/MyProject/myproject/static/theme.css | 152 ---------- .../MyProject/myproject/templates/mytemplate.pt | 67 ----- docs/narr/MyProject/myproject/tests.py | 29 -- docs/narr/MyProject/myproject/views.py | 6 - docs/narr/MyProject/production.ini | 53 ---- docs/narr/MyProject/setup.py | 49 ---- docs/narr/logging.rst | 2 +- docs/narr/myproject/.coveragerc | 3 + docs/narr/myproject/CHANGES.txt | 4 + docs/narr/myproject/MANIFEST.in | 2 + docs/narr/myproject/README.txt | 29 ++ docs/narr/myproject/development.ini | 59 ++++ docs/narr/myproject/myproject/__init__.py | 12 + .../myproject/myproject/static/pyramid-16x16.png | Bin 0 -> 1319 bytes docs/narr/myproject/myproject/static/pyramid.png | Bin 0 -> 12901 bytes docs/narr/myproject/myproject/static/theme.css | 154 ++++++++++ .../myproject/myproject/templates/layout.jinja2 | 64 ++++ .../myproject/templates/mytemplate.jinja2 | 8 + docs/narr/myproject/myproject/tests.py | 29 ++ docs/narr/myproject/myproject/views.py | 6 + docs/narr/myproject/production.ini | 53 ++++ docs/narr/myproject/pytest.ini | 3 + docs/narr/myproject/setup.py | 51 ++++ docs/narr/project.png | Bin 133242 -> 98989 bytes docs/narr/project.rst | 322 ++++++++++++--------- 32 files changed, 664 insertions(+), 582 deletions(-) delete mode 100644 docs/narr/MyProject/CHANGES.txt delete mode 100644 docs/narr/MyProject/MANIFEST.in delete mode 100644 docs/narr/MyProject/README.txt delete mode 100644 docs/narr/MyProject/development.ini delete mode 100644 docs/narr/MyProject/myproject/__init__.py delete mode 100644 docs/narr/MyProject/myproject/static/pyramid-16x16.png delete mode 100644 docs/narr/MyProject/myproject/static/pyramid.png delete mode 100644 docs/narr/MyProject/myproject/static/theme.css delete mode 100644 docs/narr/MyProject/myproject/templates/mytemplate.pt delete mode 100644 docs/narr/MyProject/myproject/tests.py delete mode 100644 docs/narr/MyProject/myproject/views.py delete mode 100644 docs/narr/MyProject/production.ini delete mode 100644 docs/narr/MyProject/setup.py create mode 100644 docs/narr/myproject/.coveragerc create mode 100644 docs/narr/myproject/CHANGES.txt create mode 100644 docs/narr/myproject/MANIFEST.in create mode 100644 docs/narr/myproject/README.txt create mode 100644 docs/narr/myproject/development.ini create mode 100644 docs/narr/myproject/myproject/__init__.py create mode 100644 docs/narr/myproject/myproject/static/pyramid-16x16.png create mode 100644 docs/narr/myproject/myproject/static/pyramid.png create mode 100644 docs/narr/myproject/myproject/static/theme.css create mode 100644 docs/narr/myproject/myproject/templates/layout.jinja2 create mode 100644 docs/narr/myproject/myproject/templates/mytemplate.jinja2 create mode 100644 docs/narr/myproject/myproject/tests.py create mode 100644 docs/narr/myproject/myproject/views.py create mode 100644 docs/narr/myproject/production.ini create mode 100644 docs/narr/myproject/pytest.ini create mode 100644 docs/narr/myproject/setup.py (limited to 'docs') diff --git a/docs/narr/MyProject/CHANGES.txt b/docs/narr/MyProject/CHANGES.txt deleted file mode 100644 index 35a34f332..000000000 --- a/docs/narr/MyProject/CHANGES.txt +++ /dev/null @@ -1,4 +0,0 @@ -0.0 ---- - -- Initial version diff --git a/docs/narr/MyProject/MANIFEST.in b/docs/narr/MyProject/MANIFEST.in deleted file mode 100644 index fa1692163..000000000 --- a/docs/narr/MyProject/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -include *.txt *.ini *.cfg *.rst -recursive-include myproject *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml diff --git a/docs/narr/MyProject/README.txt b/docs/narr/MyProject/README.txt deleted file mode 100644 index 70759eba1..000000000 --- a/docs/narr/MyProject/README.txt +++ /dev/null @@ -1,12 +0,0 @@ -MyProject README -================== - -Getting Started ---------------- - -- cd - -- $VENV/bin/pip install -e . - -- $VENV/bin/pserve development.ini - diff --git a/docs/narr/MyProject/development.ini b/docs/narr/MyProject/development.ini deleted file mode 100644 index 3a83dcfac..000000000 --- a/docs/narr/MyProject/development.ini +++ /dev/null @@ -1,59 +0,0 @@ -### -# app configuration -# http://docs.pylonsproject.org/projects/pyramid/en/1.7-branch/narr/environment.html -### - -[app:main] -use = egg:MyProject - -pyramid.reload_templates = true -pyramid.debug_authorization = false -pyramid.debug_notfound = false -pyramid.debug_routematch = false -pyramid.default_locale_name = en -pyramid.includes = - pyramid_debugtoolbar - -# By default, the toolbar only appears for clients from IP addresses -# '127.0.0.1' and '::1'. -# debugtoolbar.hosts = 127.0.0.1 ::1 - -### -# wsgi server configuration -### - -[server:main] -use = egg:waitress#main -listen = 127.0.0.1:6543 [::1]:6543 - -### -# logging configuration -# http://docs.pylonsproject.org/projects/pyramid/en/1.7-branch/narr/logging.html -### - -[loggers] -keys = root, myproject - -[handlers] -keys = console - -[formatters] -keys = generic - -[logger_root] -level = INFO -handlers = console - -[logger_myproject] -level = DEBUG -handlers = -qualname = myproject - -[handler_console] -class = StreamHandler -args = (sys.stderr,) -level = NOTSET -formatter = generic - -[formatter_generic] -format = %(asctime)s %(levelname)-5.5s [%(name)s:%(lineno)s][%(threadName)s] %(message)s diff --git a/docs/narr/MyProject/myproject/__init__.py b/docs/narr/MyProject/myproject/__init__.py deleted file mode 100644 index ad5ecbc6f..000000000 --- a/docs/narr/MyProject/myproject/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -from pyramid.config import Configurator - - -def main(global_config, **settings): - """ This function returns a Pyramid WSGI application. - """ - config = Configurator(settings=settings) - config.include('pyramid_chameleon') - config.add_static_view('static', 'static', cache_max_age=3600) - config.add_route('home', '/') - config.scan() - return config.make_wsgi_app() diff --git a/docs/narr/MyProject/myproject/static/pyramid-16x16.png b/docs/narr/MyProject/myproject/static/pyramid-16x16.png deleted file mode 100644 index 979203112..000000000 Binary files a/docs/narr/MyProject/myproject/static/pyramid-16x16.png and /dev/null differ diff --git a/docs/narr/MyProject/myproject/static/pyramid.png b/docs/narr/MyProject/myproject/static/pyramid.png deleted file mode 100644 index 4ab837be9..000000000 Binary files a/docs/narr/MyProject/myproject/static/pyramid.png and /dev/null differ diff --git a/docs/narr/MyProject/myproject/static/theme.css b/docs/narr/MyProject/myproject/static/theme.css deleted file mode 100644 index be50ad420..000000000 --- a/docs/narr/MyProject/myproject/static/theme.css +++ /dev/null @@ -1,152 +0,0 @@ -@import url(//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700); -body { - font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; - font-weight: 300; - color: #ffffff; - background: #bc2131; -} -h1, -h2, -h3, -h4, -h5, -h6 { - font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; - font-weight: 300; -} -p { - font-weight: 300; -} -.font-normal { - font-weight: 400; -} -.font-semi-bold { - font-weight: 600; -} -.font-bold { - font-weight: 700; -} -.starter-template { - margin-top: 250px; -} -.starter-template .content { - margin-left: 10px; -} -.starter-template .content h1 { - margin-top: 10px; - font-size: 60px; -} -.starter-template .content h1 .smaller { - font-size: 40px; - color: #f2b7bd; -} -.starter-template .content .lead { - font-size: 25px; - color: #f2b7bd; -} -.starter-template .content .lead .font-normal { - color: #ffffff; -} -.starter-template .links { - float: right; - right: 0; - margin-top: 125px; -} -.starter-template .links ul { - display: block; - padding: 0; - margin: 0; -} -.starter-template .links ul li { - list-style: none; - display: inline; - margin: 0 10px; -} -.starter-template .links ul li:first-child { - margin-left: 0; -} -.starter-template .links ul li:last-child { - margin-right: 0; -} -.starter-template .links ul li.current-version { - color: #f2b7bd; - font-weight: 400; -} -.starter-template .links ul li a { - color: #ffffff; -} -.starter-template .links ul li a:hover { - text-decoration: underline; -} -.starter-template .links ul li .icon-muted { - color: #eb8b95; - margin-right: 5px; -} -.starter-template .links ul li:hover .icon-muted { - color: #ffffff; -} -.starter-template .copyright { - margin-top: 10px; - font-size: 0.9em; - color: #f2b7bd; - text-transform: lowercase; - float: right; - right: 0; -} -@media (max-width: 1199px) { - .starter-template .content h1 { - font-size: 45px; - } - .starter-template .content h1 .smaller { - font-size: 30px; - } - .starter-template .content .lead { - font-size: 20px; - } -} -@media (max-width: 991px) { - .starter-template { - margin-top: 0; - } - .starter-template .logo { - margin: 40px auto; - } - .starter-template .content { - margin-left: 0; - text-align: center; - } - .starter-template .content h1 { - margin-bottom: 20px; - } - .starter-template .links { - float: none; - text-align: center; - margin-top: 60px; - } - .starter-template .copyright { - float: none; - text-align: center; - } -} -@media (max-width: 767px) { - .starter-template .content h1 .smaller { - font-size: 25px; - display: block; - } - .starter-template .content .lead { - font-size: 16px; - } - .starter-template .links { - margin-top: 40px; - } - .starter-template .links ul li { - display: block; - margin: 0; - } - .starter-template .links ul li .icon-muted { - display: none; - } - .starter-template .copyright { - margin-top: 20px; - } -} diff --git a/docs/narr/MyProject/myproject/templates/mytemplate.pt b/docs/narr/MyProject/myproject/templates/mytemplate.pt deleted file mode 100644 index 543663fe8..000000000 --- a/docs/narr/MyProject/myproject/templates/mytemplate.pt +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - Starter Scaffold for The Pyramid Web Framework - - - - - - - - - - - - - -
-
-
-
- -
-
-
-

Pyramid Starter scaffold

-

Welcome to ${project}, an application generated by
the Pyramid Web Framework 1.7.

-
-
-
-
- -
-
- -
-
-
- - - - - - - - diff --git a/docs/narr/MyProject/myproject/tests.py b/docs/narr/MyProject/myproject/tests.py deleted file mode 100644 index fd414cced..000000000 --- a/docs/narr/MyProject/myproject/tests.py +++ /dev/null @@ -1,29 +0,0 @@ -import unittest - -from pyramid import testing - - -class ViewTests(unittest.TestCase): - def setUp(self): - self.config = testing.setUp() - - def tearDown(self): - testing.tearDown() - - def test_my_view(self): - from .views import my_view - request = testing.DummyRequest() - info = my_view(request) - self.assertEqual(info['project'], 'MyProject') - - -class FunctionalTests(unittest.TestCase): - def setUp(self): - from myproject import main - app = main({}) - from webtest import TestApp - self.testapp = TestApp(app) - - def test_root(self): - res = self.testapp.get('/', status=200) - self.assertTrue(b'Pyramid' in res.body) diff --git a/docs/narr/MyProject/myproject/views.py b/docs/narr/MyProject/myproject/views.py deleted file mode 100644 index c383c5716..000000000 --- a/docs/narr/MyProject/myproject/views.py +++ /dev/null @@ -1,6 +0,0 @@ -from pyramid.view import view_config - - -@view_config(route_name='home', renderer='templates/mytemplate.pt') -def my_view(request): - return {'project': 'MyProject'} diff --git a/docs/narr/MyProject/production.ini b/docs/narr/MyProject/production.ini deleted file mode 100644 index c48ca6d9b..000000000 --- a/docs/narr/MyProject/production.ini +++ /dev/null @@ -1,53 +0,0 @@ -### -# app configuration -# http://docs.pylonsproject.org/projects/pyramid/en/1.7-branch/narr/environment.html -### - -[app:main] -use = egg:MyProject - -pyramid.reload_templates = false -pyramid.debug_authorization = false -pyramid.debug_notfound = false -pyramid.debug_routematch = false -pyramid.default_locale_name = en - -### -# wsgi server configuration -### - -[server:main] -use = egg:waitress#main -listen = *:6543 - -### -# logging configuration -# http://docs.pylonsproject.org/projects/pyramid/en/1.7-branch/narr/logging.html -### - -[loggers] -keys = root, myproject - -[handlers] -keys = console - -[formatters] -keys = generic - -[logger_root] -level = WARN -handlers = console - -[logger_myproject] -level = WARN -handlers = -qualname = myproject - -[handler_console] -class = StreamHandler -args = (sys.stderr,) -level = NOTSET -formatter = generic - -[formatter_generic] -format = %(asctime)s %(levelname)-5.5s [%(name)s:%(lineno)s][%(threadName)s] %(message)s diff --git a/docs/narr/MyProject/setup.py b/docs/narr/MyProject/setup.py deleted file mode 100644 index a911eff6d..000000000 --- a/docs/narr/MyProject/setup.py +++ /dev/null @@ -1,49 +0,0 @@ -import os - -from setuptools import setup, find_packages - -here = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(here, 'README.txt')) as f: - README = f.read() -with open(os.path.join(here, 'CHANGES.txt')) as f: - CHANGES = f.read() - -requires = [ - 'pyramid', - 'pyramid_chameleon', - 'pyramid_debugtoolbar', - 'waitress', - ] - -tests_require = [ - 'WebTest >= 1.3.1', # py3 compat - 'pytest', # includes virtualenv - 'pytest-cov', - ] - -setup(name='MyProject', - version='0.0', - description='MyProject', - long_description=README + '\n\n' + CHANGES, - classifiers=[ - "Programming Language :: Python", - "Framework :: Pyramid", - "Topic :: Internet :: WWW/HTTP", - "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", - ], - author='', - author_email='', - url='', - keywords='web pyramid pylons', - packages=find_packages(), - include_package_data=True, - zip_safe=False, - extras_require={ - 'testing': tests_require, - }, - install_requires=requires, - entry_points="""\ - [paste.app_factory] - main = myproject:main - """, - ) diff --git a/docs/narr/logging.rst b/docs/narr/logging.rst index f2c990861..ec3590e62 100644 --- a/docs/narr/logging.rst +++ b/docs/narr/logging.rst @@ -50,7 +50,7 @@ Default logging configuration is provided in both the default ``development.ini`` and the ``production.ini`` files. If you use ``pyramid-cookiecutter-starter`` to generate a Pyramid project with the name of the package as ``hello_world``, then the logging configuration in the ``development.ini`` file is as follows: -.. literalinclude:: ../quick_tour/package/development.ini +.. literalinclude:: MyProject/development.ini :language: ini :lineno-match: :lines: 29- diff --git a/docs/narr/myproject/.coveragerc b/docs/narr/myproject/.coveragerc new file mode 100644 index 000000000..f0c31d6d7 --- /dev/null +++ b/docs/narr/myproject/.coveragerc @@ -0,0 +1,3 @@ +[run] +source = myproject +omit = myproject/test* diff --git a/docs/narr/myproject/CHANGES.txt b/docs/narr/myproject/CHANGES.txt new file mode 100644 index 000000000..14b902fd1 --- /dev/null +++ b/docs/narr/myproject/CHANGES.txt @@ -0,0 +1,4 @@ +0.0 +--- + +- Initial version. diff --git a/docs/narr/myproject/MANIFEST.in b/docs/narr/myproject/MANIFEST.in new file mode 100644 index 000000000..1c24b8c0c --- /dev/null +++ b/docs/narr/myproject/MANIFEST.in @@ -0,0 +1,2 @@ +include *.txt *.ini *.cfg *.rst +recursive-include myproject *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.jinja2 diff --git a/docs/narr/myproject/README.txt b/docs/narr/myproject/README.txt new file mode 100644 index 000000000..41ef0ff91 --- /dev/null +++ b/docs/narr/myproject/README.txt @@ -0,0 +1,29 @@ +MyProject +=============================== + +Getting Started +--------------- + +- Change directory into your newly created project. + + cd MyProject + +- Create a Python virtual environment. + + python3 -m venv env + +- Upgrade packaging tools. + + env/bin/pip install --upgrade pip setuptools + +- Install the project in editable mode with its testing requirements. + + env/bin/pip install -e ".[testing]" + +- Run your project's tests. + + env/bin/pytest + +- Run your project. + + env/bin/pserve development.ini diff --git a/docs/narr/myproject/development.ini b/docs/narr/myproject/development.ini new file mode 100644 index 000000000..5d110805a --- /dev/null +++ b/docs/narr/myproject/development.ini @@ -0,0 +1,59 @@ +### +# app configuration +# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html +### + +[app:main] +use = egg:myproject + +pyramid.reload_templates = true +pyramid.debug_authorization = false +pyramid.debug_notfound = false +pyramid.debug_routematch = false +pyramid.default_locale_name = en +pyramid.includes = + pyramid_debugtoolbar + +# By default, the toolbar only appears for clients from IP addresses +# '127.0.0.1' and '::1'. +# debugtoolbar.hosts = 127.0.0.1 ::1 + +### +# wsgi server configuration +### + +[server:main] +use = egg:waitress#main +listen = 127.0.0.1:6543 [::1]:6543 + +### +# logging configuration +# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html +### + +[loggers] +keys = root, myproject + +[handlers] +keys = console + +[formatters] +keys = generic + +[logger_root] +level = INFO +handlers = console + +[logger_myproject] +level = DEBUG +handlers = +qualname = myproject + +[handler_console] +class = StreamHandler +args = (sys.stderr,) +level = NOTSET +formatter = generic + +[formatter_generic] +format = %(asctime)s %(levelname)-5.5s [%(name)s:%(lineno)s][%(threadName)s] %(message)s diff --git a/docs/narr/myproject/myproject/__init__.py b/docs/narr/myproject/myproject/__init__.py new file mode 100644 index 000000000..49dde36d4 --- /dev/null +++ b/docs/narr/myproject/myproject/__init__.py @@ -0,0 +1,12 @@ +from pyramid.config import Configurator + + +def main(global_config, **settings): + """ This function returns a Pyramid WSGI application. + """ + config = Configurator(settings=settings) + config.include('pyramid_jinja2') + config.add_static_view('static', 'static', cache_max_age=3600) + config.add_route('home', '/') + config.scan() + return config.make_wsgi_app() diff --git a/docs/narr/myproject/myproject/static/pyramid-16x16.png b/docs/narr/myproject/myproject/static/pyramid-16x16.png new file mode 100644 index 000000000..979203112 Binary files /dev/null and b/docs/narr/myproject/myproject/static/pyramid-16x16.png differ diff --git a/docs/narr/myproject/myproject/static/pyramid.png b/docs/narr/myproject/myproject/static/pyramid.png new file mode 100644 index 000000000..4ab837be9 Binary files /dev/null and b/docs/narr/myproject/myproject/static/pyramid.png differ diff --git a/docs/narr/myproject/myproject/static/theme.css b/docs/narr/myproject/myproject/static/theme.css new file mode 100644 index 000000000..0f4b1a4d4 --- /dev/null +++ b/docs/narr/myproject/myproject/static/theme.css @@ -0,0 +1,154 @@ +@import url(//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700); +body { + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-weight: 300; + color: #ffffff; + background: #bc2131; +} +h1, +h2, +h3, +h4, +h5, +h6 { + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-weight: 300; +} +p { + font-weight: 300; +} +.font-normal { + font-weight: 400; +} +.font-semi-bold { + font-weight: 600; +} +.font-bold { + font-weight: 700; +} +.starter-template { + margin-top: 250px; +} +.starter-template .content { + margin-left: 10px; +} +.starter-template .content h1 { + margin-top: 10px; + font-size: 60px; +} +.starter-template .content h1 .smaller { + font-size: 40px; + color: #f2b7bd; +} +.starter-template .content .lead { + font-size: 25px; + color: #f2b7bd; +} +.starter-template .content .lead .font-normal { + color: #ffffff; +} +.starter-template .links { + float: right; + right: 0; + margin-top: 125px; +} +.starter-template .links ul { + display: block; + padding: 0; + margin: 0; +} +.starter-template .links ul li { + list-style: none; + display: inline; + margin: 0 10px; +} +.starter-template .links ul li:first-child { + margin-left: 0; +} +.starter-template .links ul li:last-child { + margin-right: 0; +} +.starter-template .links ul li.current-version { + color: #f2b7bd; + font-weight: 400; +} +.starter-template .links ul li a, a { + color: #f2b7bd; + text-decoration: underline; +} +.starter-template .links ul li a:hover, a:hover { + color: #ffffff; + text-decoration: underline; +} +.starter-template .links ul li .icon-muted { + color: #eb8b95; + margin-right: 5px; +} +.starter-template .links ul li:hover .icon-muted { + color: #ffffff; +} +.starter-template .copyright { + margin-top: 10px; + font-size: 0.9em; + color: #f2b7bd; + text-transform: lowercase; + float: right; + right: 0; +} +@media (max-width: 1199px) { + .starter-template .content h1 { + font-size: 45px; + } + .starter-template .content h1 .smaller { + font-size: 30px; + } + .starter-template .content .lead { + font-size: 20px; + } +} +@media (max-width: 991px) { + .starter-template { + margin-top: 0; + } + .starter-template .logo { + margin: 40px auto; + } + .starter-template .content { + margin-left: 0; + text-align: center; + } + .starter-template .content h1 { + margin-bottom: 20px; + } + .starter-template .links { + float: none; + text-align: center; + margin-top: 60px; + } + .starter-template .copyright { + float: none; + text-align: center; + } +} +@media (max-width: 767px) { + .starter-template .content h1 .smaller { + font-size: 25px; + display: block; + } + .starter-template .content .lead { + font-size: 16px; + } + .starter-template .links { + margin-top: 40px; + } + .starter-template .links ul li { + display: block; + margin: 0; + } + .starter-template .links ul li .icon-muted { + display: none; + } + .starter-template .copyright { + margin-top: 20px; + } +} diff --git a/docs/narr/myproject/myproject/templates/layout.jinja2 b/docs/narr/myproject/myproject/templates/layout.jinja2 new file mode 100644 index 000000000..bfac9e64e --- /dev/null +++ b/docs/narr/myproject/myproject/templates/layout.jinja2 @@ -0,0 +1,64 @@ + + + + + + + + + + + Cookiecutter Starter project for the Pyramid Web Framework + + + + + + + + + + + + + +
+
+
+
+ +
+
+ {% block content %} +

No content

+ {% endblock content %} +
+
+ +
+ +
+
+
+ + + + + + + + diff --git a/docs/narr/myproject/myproject/templates/mytemplate.jinja2 b/docs/narr/myproject/myproject/templates/mytemplate.jinja2 new file mode 100644 index 000000000..ce042215d --- /dev/null +++ b/docs/narr/myproject/myproject/templates/mytemplate.jinja2 @@ -0,0 +1,8 @@ +{% extends "layout.jinja2" %} + +{% block content %} +
+

Pyramid Starter project

+

Welcome to MyProject, a Pyramid application generated by
Cookiecutter.

+
+{% endblock content %} diff --git a/docs/narr/myproject/myproject/tests.py b/docs/narr/myproject/myproject/tests.py new file mode 100644 index 000000000..fd414cced --- /dev/null +++ b/docs/narr/myproject/myproject/tests.py @@ -0,0 +1,29 @@ +import unittest + +from pyramid import testing + + +class ViewTests(unittest.TestCase): + def setUp(self): + self.config = testing.setUp() + + def tearDown(self): + testing.tearDown() + + def test_my_view(self): + from .views import my_view + request = testing.DummyRequest() + info = my_view(request) + self.assertEqual(info['project'], 'MyProject') + + +class FunctionalTests(unittest.TestCase): + def setUp(self): + from myproject import main + app = main({}) + from webtest import TestApp + self.testapp = TestApp(app) + + def test_root(self): + res = self.testapp.get('/', status=200) + self.assertTrue(b'Pyramid' in res.body) diff --git a/docs/narr/myproject/myproject/views.py b/docs/narr/myproject/myproject/views.py new file mode 100644 index 000000000..9e9ec4320 --- /dev/null +++ b/docs/narr/myproject/myproject/views.py @@ -0,0 +1,6 @@ +from pyramid.view import view_config + + +@view_config(route_name='home', renderer='templates/mytemplate.jinja2') +def my_view(request): + return {'project': 'MyProject'} diff --git a/docs/narr/myproject/production.ini b/docs/narr/myproject/production.ini new file mode 100644 index 000000000..13be488e7 --- /dev/null +++ b/docs/narr/myproject/production.ini @@ -0,0 +1,53 @@ +### +# app configuration +# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html +### + +[app:main] +use = egg:myproject + +pyramid.reload_templates = false +pyramid.debug_authorization = false +pyramid.debug_notfound = false +pyramid.debug_routematch = false +pyramid.default_locale_name = en + +### +# wsgi server configuration +### + +[server:main] +use = egg:waitress#main +listen = *:6543 + +### +# logging configuration +# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html +### + +[loggers] +keys = root, myproject + +[handlers] +keys = console + +[formatters] +keys = generic + +[logger_root] +level = WARN +handlers = console + +[logger_myproject] +level = WARN +handlers = +qualname = myproject + +[handler_console] +class = StreamHandler +args = (sys.stderr,) +level = NOTSET +formatter = generic + +[formatter_generic] +format = %(asctime)s %(levelname)-5.5s [%(name)s:%(lineno)s][%(threadName)s] %(message)s diff --git a/docs/narr/myproject/pytest.ini b/docs/narr/myproject/pytest.ini new file mode 100644 index 000000000..b1b5f4c38 --- /dev/null +++ b/docs/narr/myproject/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +testpaths = myproject +python_files = *.py diff --git a/docs/narr/myproject/setup.py b/docs/narr/myproject/setup.py new file mode 100644 index 000000000..00e377349 --- /dev/null +++ b/docs/narr/myproject/setup.py @@ -0,0 +1,51 @@ +import os + +from setuptools import setup, find_packages + +here = os.path.abspath(os.path.dirname(__file__)) +with open(os.path.join(here, 'README.txt')) as f: + README = f.read() +with open(os.path.join(here, 'CHANGES.txt')) as f: + CHANGES = f.read() + +requires = [ + 'pyramid', + 'pyramid_jinja2', + 'pyramid_debugtoolbar', + 'waitress', +] + +tests_require = [ + 'WebTest >= 1.3.1', # py3 compat + 'pytest', + 'pytest-cov', +] + +setup( + name='myproject', + version='0.0', + description='MyProject', + long_description=README + '\n\n' + CHANGES, + classifiers=[ + 'Programming Language :: Python', + 'Framework :: Pyramid', + 'Topic :: Internet :: WWW/HTTP', + 'Topic :: Internet :: WWW/HTTP :: WSGI :: Application', + ], + author='', + author_email='', + url='', + keywords='web pyramid pylons', + packages=find_packages(), + include_package_data=True, + zip_safe=False, + extras_require={ + 'testing': tests_require, + }, + install_requires=requires, + entry_points={ + 'paste.app_factory': [ + 'main = myproject:main', + ], + }, +) diff --git a/docs/narr/project.png b/docs/narr/project.png index e1afd97d4..0e17e57ab 100644 Binary files a/docs/narr/project.png and b/docs/narr/project.png differ diff --git a/docs/narr/project.rst b/docs/narr/project.rst index 118a9fa89..61759fe34 100644 --- a/docs/narr/project.rst +++ b/docs/narr/project.rst @@ -23,7 +23,7 @@ These cookiecutters are rendered using the ``cookiecutter`` command that you may .. seealso:: - + See also `Cookiecutter Installation `_. .. index:: @@ -37,73 +37,103 @@ These cookiecutters are rendered using the ``cookiecutter`` command that you may :app:`Pyramid` cookiecutters ---------------------------- -Pyramid cookiecutters released under the Pylons Project include: - -* `pyramid-cookiecutter-alchemy `_ -* `pyramid-cookiecutter-starter `_ -* `pyramid-cookiecutter-zodb `_ +Pyramid cookiecutters released under the Pylons Project include differ from each other on a number of axes: +- the persistence mechanism they offer (no persistence mechanism, :term:`SQLAlchemy` with SQLite, or :term:`ZODB`) -The convenience scaffolds included with :app:`Pyramid` differ from each other -on a number of axes: +- the mechanism they use to map URLs to code (:term:`URL dispatch` or :term:`traversal`) -- the persistence mechanism they offer (no persistence mechanism, :term:`ZODB`, - or :term:`SQLAlchemy`) +- templating libraries (:term:`Jinja2` or :term:`Chameleon`) -- the mechanism they use to map URLs to code (:term:`traversal` or :term:`URL - dispatch`) +* `pyramid-cookiecutter-starter `_ +* `pyramid-cookiecutter-alchemy `_ +* `pyramid-cookiecutter-zodb `_ -The included scaffolds are these: +These cookiecutters include: -``starter`` - URL mapping via :term:`URL dispatch` and no persistence mechanism +``pyramid-cookiecutter-starter`` + :term:`URL dispatch` for routing and :term:`Jinja2` for templating -``zodb`` - URL mapping via :term:`traversal` and persistence via :term:`ZODB` +``pyramid-cookiecutter-alchemy`` + SQLite for persistent storage, :term:`SQLAlchemy` for an ORM, :term:`URL dispatch` for routing, and :term:`Jinja2` for templating. -``alchemy`` - URL mapping via :term:`URL dispatch` and persistence via :term:`SQLAlchemy` +``pyramid-cookiecutter-zodb`` + :term:`ZODB` for persistent storage, :term:`traversal` for routing, and :term:`Chameleon` for templating .. index:: single: creating a project single: project - single: pcreate + single: cookiecutter .. _creating_a_project: Creating the Project -------------------- -.. seealso:: See also the output of :ref:`pcreate --help `. - In :ref:`installing_chapter`, you created a virtual Python environment via the -``venv`` command. To start a :app:`Pyramid` :term:`project`, use the -``pcreate`` command installed within the virtual environment. We'll choose the -``starter`` scaffold for this purpose. When we invoke ``pcreate``, it will -create a directory that represents our project. +``venv`` command. We called the virtual environment directory +``env`` and set an environment variable ``VENV`` to its path. + +We assume that you previously installed cookiecutter using the following command: + +.. code-block:: bash + + $ $VENV/bin/pip install cookiecutter -In :ref:`installing_chapter` we called the virtual environment directory -``env``. The following commands assume that our current working directory is -the ``env`` directory. +We'll choose ``pyramid-cookiecutter-starter`` to start the project. When we invoke ``cookiecutter``, it will create a directory that represents our project. -The below example uses the ``pcreate`` command to create a project with the -``starter`` scaffold. +The following commands assume that our current working directory is the value of ``$VENV``. On UNIX: .. code-block:: bash - $ $VENV/bin/pcreate -s starter MyProject + $ $VENV/bin/cookiecutter https://github.com/Pylons/pyramid-cookiecutter-starter Or on Windows: .. code-block:: doscon - c:\> %VENV%\Scripts\pcreate -s starter MyProject + c:\> %VENV%\cookiecutter https://github.com/Pylons/pyramid-cookiecutter-starter + +If prompted for the first item, accept the default ``yes`` by hitting return. + +#. ``You've cloned ~/.cookiecutters/pyramid-cookiecutter-starter before. Is it + okay to delete and re-clone it? [yes]:`` +#. ``project_name [Pyramid Scaffold]: myproject`` +#. ``repo_name [scaffold]: myproject`` + +We then run through the following commands. + +On UNIX: + +.. code-block:: bash + + # Reset our environment variable for a new virtual environment. + $ export VENV=~/env/myproject/env + # Change directory into your newly created project. + $ cd myproject + # Create a new virtual environment... + $ python3 -m venv $VENV + # ...where we upgrade packaging tools. + $ env/bin/pip install --upgrade pip setuptools + +Or on Windows: + +.. code-block:: doscon -As a result of invoking the ``pcreate`` command, a directory named -``MyProject`` is created. That directory is a :term:`project` directory. The + # Reset our environment variable for a new virtual environment. + c:\> set VENV=c:\env\myproject\env + # Change directory into your newly created project. + c:\> cd myproject + # Create a new virtual environment... + c:\myproject\> c:\Python3x\python -m venv %VENV% + # ...where we upgrade packaging tools. + c:\myproject\> %VENV%\Scripts\pip install --upgrade pip setuptools + +As a result of invoking the ``cookiecutter`` command, a directory named +``myproject`` is created. That directory is a :term:`project` directory. The ``setup.py`` file in that directory can be used to distribute your application, or install your application for deployment or development. @@ -118,15 +148,15 @@ debugger (to prevent inappropriate access and disclosure), and turns off a number of debugging settings. You can use this file to put your application into production. -The ``MyProject`` project directory contains an additional subdirectory named +The ``myproject`` project directory contains an additional subdirectory named ``myproject`` (note the case difference) representing a Python :term:`package` which holds very simple :app:`Pyramid` sample code. This is where you'll edit your application's Python code and templates. -We created this project within an ``env`` virtual environment directory. +We created this project in a directory next to its virtual environment directory. However, note that this is not mandatory. The project directory can go more or less anywhere on your filesystem. You don't need to put it in a special "web -server" directory, and you don't need to put it within a virtual environment +server" directory. You could put it within a virtual environment directory. The author uses Linux mainly, and tends to put project directories which he creates within his ``~/projects`` directory. On Windows, it's a good idea to put project directories within a directory that contains no space @@ -136,7 +166,7 @@ projects in ``C:\projects``. .. warning:: - You'll need to avoid using ``pcreate`` to create a project with the same + You'll need to avoid using ``cookiecutter`` to create a project with the same name as a Python standard library component. In particular, this means you should avoid using the names ``site`` or ``test``, both of which conflict with Python standard library packages. You should also avoid using the name @@ -155,7 +185,7 @@ newly created project directory and use the Python interpreter from the invoke the command ``pip install -e .``, which installs the project in development mode (``-e`` is for "editable") into the current directory (``.``). -The file named ``setup.py`` will be in the root of the pcreate-generated +The file named ``setup.py`` will be in the root of the cookiecutter-generated project directory. The ``python`` you're invoking should be the one that lives in the ``bin`` (or ``Scripts`` on Windows) directory of your virtual Python environment. Your terminal's current working directory *must* be the newly @@ -165,25 +195,24 @@ On UNIX: .. code-block:: bash - $ cd MyProject - $ $VENV/bin/pip install -e . + $ $VENV/bin/pip install -e . Or on Windows: .. code-block:: doscon - c:\> cd MyProject - c:\> %VENV%\Scripts\pip install -e . + c:\env\myproject\> %VENV%\Scripts\pip install -e . Elided output from a run of this command on UNIX is shown below: .. code-block:: bash - $ cd MyProject - $ $VENV/bin/pip install -e . - ... - Successfully installed Chameleon-2.24 Mako-1.0.4 MyProject \ - pyramid-chameleon-0.3 pyramid-debugtoolbar-2.4.2 pyramid-mako-1.0.2 + Running setup.py develop for myproject + Successfully installed Jinja2-2.8 Mako-1.0.6 MarkupSafe-0.23 \ + PasteDeploy-1.5.2 Pygments-2.1.3 WebOb-1.7.0 myproject pyramid-1.7.3 \ + pyramid-debugtoolbar-3.0.5 pyramid-jinja2-2.7 pyramid-mako-1.0.2 \ + repoze.lru-0.6 translationstring-1.3 venusian-1.0 waitress-1.0.1 \ + zope.deprecation-4.2.0 zope.interface-4.3.3 This will install a :term:`distribution` representing your project into the virtual environment interpreter's library set so it can be found by ``import`` @@ -210,7 +239,7 @@ On Windows: .. code-block:: doscon - c:\> %VENV%\Scripts\pip install -e ".[testing]" + c:\env\myproject\> %VENV%\Scripts\pip install -e ".[testing]" Once the testing requirements are installed, then you can run the tests using the ``py.test`` command that was just installed in the ``bin`` directory of @@ -226,7 +255,7 @@ On Windows: .. code-block:: doscon - c:\> %VENV%\Scripts\py.test -q + c:\env\myproject\> %VENV%\Scripts\py.test -q Here's sample output from a test run on UNIX: @@ -236,9 +265,7 @@ Here's sample output from a test run on UNIX: .. 2 passed in 0.47 seconds -The tests themselves are found in the ``tests.py`` module in your ``pcreate`` -generated project. Within a project generated by the ``starter`` scaffold, -only two sample tests exist. +The tests themselves are found in the ``tests.py`` module in your ``cookiecutter``-generated project. Within a project generated by the ``pyramid-cookiecutter-starter`` cookiecutter, only two sample tests exist. .. note:: @@ -253,7 +280,7 @@ to ``py.test``: $ $VENV/bin/py.test --cov -q -Scaffolds include configuration defaults for ``py.test`` and test coverage. +Cookiecutters include configuration defaults for ``py.test`` and test coverage. These configuration files are ``pytest.ini`` and ``.coveragerc``, located at the root of your package. Without these defaults, we would need to specify the path to the module on which we want to run tests and coverage. @@ -291,19 +318,18 @@ On UNIX: On Windows: -.. code-block:: text +.. code-block:: doscon - c:\> %VENV%\Scripts\pserve development.ini + c:\env\myproject\> %VENV%\Scripts\pserve development.ini Here's sample output from a run of ``pserve`` on UNIX: .. code-block:: bash $ $VENV/bin/pserve development.ini - Starting server in PID 16208. - Serving on http://127.0.0.1:6543 - Serving on http://[::1]:6543 - + Starting server in PID 77171. + Serving on http://localhost:6543 + Serving on http://localhost:6543 Access is restricted such that only a browser running on the same machine as Pyramid will be able to access your Pyramid application. However, if you want @@ -340,8 +366,8 @@ You can shut down a server started this way by pressing ``Ctrl-C`` (or ``Ctrl-Break`` on Windows). The default server used to run your Pyramid application when a project is -created from a scaffold is named :term:`Waitress`. This server is what prints -the ``serving on...`` line when you run ``pserve``. It's a good idea to use +created from a cookiecutter is named :term:`Waitress`. This server is what prints +the ``Serving on...`` line when you run ``pserve``. It's a good idea to use this server during development because it's very simple. It can also be used for light production. Setting your application up under a different server is not advised until you've done some development work under the default server, @@ -378,7 +404,8 @@ For example, on UNIX: $ $VENV/bin/pserve development.ini --reload Starting subprocess with file monitor Starting server in PID 16601. - serving on http://127.0.0.1:6543 + Serving on http://localhost:6543 + Serving on http://localhost:6543 Now if you make a change to any of your project's ``.py`` files or ``.ini`` files, you'll see the server restart automatically: @@ -388,12 +415,13 @@ files, you'll see the server restart automatically: development.ini changed; reloading... -------------------- Restarting -------------------- Starting server in PID 16602. - serving on http://127.0.0.1:6543 + Serving on http://localhost:6543 + Serving on http://localhost:6543 Changes to template files (such as ``.pt`` or ``.mak`` files) won't cause the server to restart. Changes to template files don't require a server restart as long as the ``pyramid.reload_templates`` setting in the ``development.ini`` -file is ``true``. Changes made to template files when this setting is true +file is ``true``. Changes made to template files when this setting is ``true`` will take effect immediately without a server restart. .. index:: @@ -408,8 +436,8 @@ browser like what is displayed in the following image: .. image:: project.png -This is the page shown by default when you visit an unmodified ``pcreate`` -generated ``starter`` application in a browser. +This is the page shown by default when you visit an unmodified ``cookiecutter`` +generated ``pyramid-cookiecutter-starter`` application in a browser. .. index:: single: debug toolbar @@ -490,48 +518,57 @@ this: The Project Structure --------------------- -The ``starter`` scaffold generated a :term:`project` (named ``MyProject``), +The ``pyramid-cookiecutter-starter`` cookiecutter generated a :term:`project` (named ``myproject``), which contains a Python :term:`package`. The package is *also* named -``myproject``, but it's lowercased; the scaffold generates a project which -contains a package that shares its name except for case. +``myproject``; the cookiecutter generates a project which +contains a package that shares its name. -All :app:`Pyramid` ``pcreate``-generated projects share a similar structure. -The ``MyProject`` project we've generated has the following directory structure: +All :app:`Pyramid` ``cookiecutter``-generated projects share a similar structure. +The ``myproject`` project we've generated has the following directory structure: .. code-block:: text - MyProject/ - |-- CHANGES.txt - |-- development.ini - |-- MANIFEST.in - |-- myproject - | |-- __init__.py - | |-- static - | | |-- pyramid-16x16.png - | | |-- pyramid.png - | | |-- theme.css - | | `-- theme.min.css - | |-- templates - | | `-- mytemplate.pt - | |-- tests.py - | `-- views.py - |-- production.ini - |-- README.txt - `-- setup.py - -The ``MyProject`` :term:`Project` + myproject/ + ├── .coveragerc + ├── CHANGES.txt + ├── MANIFEST.in + ├── myproject + │   ├── __init__.py + │   ├── static + │   │   ├── pyramid-16x16.png + │   │   ├── pyramid.png + │   │   └── theme.css + │   ├── templates + │   │   ├── layout.jinja2 + │   │   └── mytemplate.jinja2 + │   ├── tests.py + │   └── views.py + ├── README.txt + ├── development.ini + ├── production.ini + ├── pytest.ini + └── setup.py + + +The ``myproject`` :term:`Project` --------------------------------- -The ``MyProject`` :term:`project` directory is the distribution and deployment +The ``myproject`` :term:`project` directory is the distribution and deployment wrapper for your application. It contains both the ``myproject`` :term:`package` representing your application as well as files used to describe, run, and test your application. +#. ``.coveragerc`` configures coverage when running tests. + #. ``CHANGES.txt`` describes the changes you've made to the application. It is - conventionally written in :term:`ReStructuredText` format. + conventionally written in :term:`reStructuredText` format. + +#. ``MANIFEST.in`` is a :term:`distutils` "manifest" file, naming which files + should be included in a source distribution of the package when ``python + setup.py sdist`` is run. #. ``README.txt`` describes the application in general. It is conventionally - written in :term:`ReStructuredText` format. + written in :term:`reStructuredText` format. #. ``development.ini`` is a :term:`PasteDeploy` configuration file that can be used to execute your application during development. @@ -539,9 +576,7 @@ describe, run, and test your application. #. ``production.ini`` is a :term:`PasteDeploy` configuration file that can be used to execute your application in a production configuration. -#. ``MANIFEST.in`` is a :term:`distutils` "manifest" file, naming which files - should be included in a source distribution of the package when ``python - setup.py sdist`` is run. +#. ``pytest.ini`` is a configuration file for running tests. #. ``setup.py`` is the file you'll use to test and distribute your application. It is a standard :term:`setuptools` ``setup.py`` file. @@ -550,7 +585,7 @@ describe, run, and test your application. single: PasteDeploy single: ini file -.. _MyProject_ini: +.. _myproject_ini: ``development.ini`` ~~~~~~~~~~~~~~~~~~~ @@ -561,7 +596,7 @@ as the deployment settings provided to that application. The generated ``development.ini`` file looks like so: -.. literalinclude:: MyProject/development.ini +.. literalinclude:: myproject/development.ini :language: ini :linenos: @@ -570,15 +605,15 @@ This file contains several sections including ``[app:main]``, The ``[app:main]`` section represents configuration for your :app:`Pyramid` application. The ``use`` setting is the only setting required to be present in -the ``[app:main]`` section. Its default value, ``egg:MyProject``, indicates -that our MyProject project contains the application that should be served. +the ``[app:main]`` section. Its default value, ``egg:myproject``, indicates +that our myproject project contains the application that should be served. Other settings added to this section are passed as keyword arguments to the function named ``main`` in our package's ``__init__.py`` module. You can provide startup-time configuration parameters to your application by adding more settings to this section. .. seealso:: See :ref:`pastedeploy_entry_points` for more information about the - meaning of the ``use = egg:MyProject`` value in this section. + meaning of the ``use = egg:myproject`` value in this section. The ``pyramid.reload_templates`` setting in the ``[app:main]`` section is a :app:`Pyramid`-specific setting which is passed into the framework. If it @@ -612,7 +647,7 @@ The ``[server:main]`` section of the configuration file configures a WSGI server which listens on TCP port 6543. It is configured to listen on localhost only (``127.0.0.1``). -.. _MyProject_ini_logging: +.. _myproject_ini_logging: The sections after ``# logging configuration`` represent Python's standard library :mod:`logging` module configuration for your application. These @@ -673,7 +708,7 @@ directory didn't contain a ``MANIFEST.in`` file that told the ``sdist`` machinery to include ``*.pt`` files, the ``myproject/templates/mytemplate.pt`` file would not be included in the generated tarball. -Projects generated by Pyramid scaffolds include a default ``MANIFEST.in`` file. +Projects generated by Pyramid cookiecutters include a default ``MANIFEST.in`` file. The ``MANIFEST.in`` file contains declarations which tell it to include files like ``*.pt``, ``*.css`` and ``*.js`` in the generated tarball. If you include files with extensions other than the files named in the project's @@ -713,7 +748,7 @@ testing, as well as distributing your application. Our generated ``setup.py`` looks like this: -.. literalinclude:: MyProject/setup.py +.. literalinclude:: myproject/setup.py :language: python :linenos: @@ -756,7 +791,7 @@ you can try this command now: $ $VENV/bin/python setup.py sdist This will create a tarball of your application in a ``dist`` subdirectory named -``MyProject-0.0.tar.gz``. You can send this tarball to other people who want +``myproject-0.0.tar.gz``. You can send this tarball to other people who want to install and use your application. .. index:: @@ -765,7 +800,7 @@ to install and use your application. The ``myproject`` :term:`Package` --------------------------------- -The ``myproject`` :term:`package` lives inside the ``MyProject`` +The ``myproject`` :term:`package` lives inside the ``myproject`` :term:`project`. It contains: #. An ``__init__.py`` file signifies that this is a Python :term:`package`. It @@ -773,14 +808,14 @@ The ``myproject`` :term:`package` lives inside the ``MyProject`` ``main`` function which is used as a entry point for commands such as ``pserve``, ``pshell``, ``pviews``, and others. -#. A ``templates`` directory, which contains :term:`Chameleon` (or other types +#. A ``templates`` directory, which contains :term:`Jinja2` (or other types of) templates. #. A ``tests.py`` module, which contains unit test code for the application. #. A ``views.py`` module, which contains view code for the application. -These are purely conventions established by the scaffold. :app:`Pyramid` +These are purely conventions established by the cookiecutter. :app:`Pyramid` doesn't insist that you name things in any particular way. However, it's generally a good idea to follow Pyramid standards for naming, so that other Pyramid developers can get up to speed quickly on your code when you need help. @@ -798,7 +833,7 @@ advertises an entry point for use by our :term:`PasteDeploy` ``.ini`` file. This is the file named ``__init__.py``. The presence of an ``__init__.py`` also informs Python that the directory which contains it is a *package*. -.. literalinclude:: MyProject/myproject/__init__.py +.. literalinclude:: myproject/myproject/__init__.py :language: python :linenos: @@ -813,8 +848,8 @@ also informs Python that the directory which contains it is a *package*. Line 7 creates an instance of a :term:`Configurator`. - Line 8 adds support for Chameleon templating bindings, allowing us to - specify renderers with the ``.pt`` extension. + Line 8 adds support for Jinja2 templating bindings, allowing us to + specify renderers with the ``.jinja2`` extension. Line 9 registers a static view, which will serve up the files from the ``myproject:static`` :term:`asset specification` (the ``static`` directory @@ -840,7 +875,7 @@ callables*. A :term:`view callable` is the main tool of a :app:`Pyramid` web application developer; it is a bit of code which accepts a :term:`request` and which returns a :term:`response`. -.. literalinclude:: MyProject/myproject/views.py +.. literalinclude:: myproject/myproject/views.py :language: python :linenos: @@ -857,8 +892,8 @@ result of the view callable. This particular view declaration points at specifies the ``mytemplate.pt`` file within the ``templates`` directory of the ``myproject`` package. The asset specification could have also been specified as ``myproject:templates/mytemplate.pt``; the leading package name and colon is -optional. The template file pointed to is a :term:`Chameleon` ZPT template -file (``templates/my_template.pt``). +optional. The template file pointed to is a :term:`Jinja2` template +file (``templates/my_template.jinja2``). This view callable function is handed a single piece of information: the :term:`request`. The *request* is an instance of the :term:`WebOb` ``Request`` @@ -871,9 +906,9 @@ the HTML in a :term:`response`. .. note:: Dictionaries provide values to :term:`template`\s. -.. note:: When the application is run with the scaffold's :ref:`default - development.ini ` configuration, :ref:`logging is set up - ` to aid debugging. If an exception is raised, +.. note:: When the application is run with the cookiecutter's :ref:`default + development.ini ` configuration, :ref:`logging is set up + ` to aid debugging. If an exception is raised, uncaught tracebacks are displayed after the startup messages on :ref:`the console running the server `. Also ``print()`` statements may be inserted into the application for debugging to @@ -882,7 +917,7 @@ the HTML in a :term:`response`. .. note:: ``development.ini`` has a setting that controls how templates are reloaded, ``pyramid.reload_templates``. - - When set to ``True`` (as in the scaffold ``development.ini``), changed + - When set to ``True`` (as in the cookiecutter ``development.ini``), changed templates automatically reload without a server restart. This is convenient while developing, but slows template rendering speed. @@ -913,31 +948,46 @@ the HTML in a :term:`response`. ``static`` ~~~~~~~~~~ -This directory contains static assets which support the ``mytemplate.pt`` +This directory contains static assets which support the ``layout.jinja2`` template. It includes CSS and images. -``templates/mytemplate.pt`` + +``templates/layout.jinja2`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -This is the single :term:`Chameleon` template that exists in the project. Its -contents are too long to show here, but it displays a default page when -rendered. It is referenced by the call to ``@view_config`` as the ``renderer`` +This is the base layout content. It contains a single marker for content block. Other templates inherit its content, providing layout for the web application. Its contents are too long to show here, but here is an excerpt: + +.. literalinclude:: myproject/myproject/templates/layout.jinja2 + :language: jinja + :lines: 34-38 + :lineno-match: + + +``templates/mytemplate.jinja2`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This is the content :term:`Jinja2` template that exists in the project. It is referenced by the call to ``@view_config`` as the ``renderer`` of the ``my_view`` view callable in the ``views.py`` file. See -:ref:`views_which_use_a_renderer` for more information about renderers. +:ref:`views_which_use_a_renderer` for more information about renderers. It inherits ("extends") the HTML provided by ``layout.jinja2``, replacing the content block with its own content. + +.. literalinclude:: myproject/myproject/templates/mytemplate.jinja2 + :language: jinja + :linenos: Templates are accessed and used by view configurations and sometimes by view functions themselves. See :ref:`templates_used_directly` and :ref:`templates_used_as_renderers`. + .. index:: single: tests.py ``tests.py`` ~~~~~~~~~~~~ -The ``tests.py`` module includes unit tests for your application. +The ``tests.py`` module includes tests for your application. -.. literalinclude:: MyProject/myproject/tests.py +.. literalinclude:: myproject/myproject/tests.py :language: python :linenos: @@ -959,16 +1009,16 @@ Modifying Package Structure --------------------------- It is best practice for your application's code layout to not stray too much -from accepted Pyramid scaffold defaults. If you refrain from changing things +from accepted Pyramid cookiecutter defaults. If you refrain from changing things very much, other Pyramid coders will be able to more quickly understand your -application. However, the code layout choices made for you by a scaffold are +application. However, the code layout choices made for you by a cookiecutter are in no way magical or required. Despite the choices made for you by any -scaffold, you can decide to lay your code out any way you see fit. +cookiecutter, you can decide to lay your code out any way you see fit. For example, the configuration method named :meth:`~pyramid.config.Configurator.add_view` requires you to pass a :term:`dotted Python name` or a direct object reference as the class or -function to be used as a view. By default, the ``starter`` scaffold would have +function to be used as a view. By default, the ``starter`` cookiecutter would have you add view functions to the ``views.py`` module in your package. However, you might be more comfortable creating a ``views`` *directory*, and adding a single file for each view. @@ -1010,7 +1060,7 @@ Pyramid application via ``pserve``. This can be a useful debugging tool. See What Is This ``pserve`` Thing ----------------------------- -The code generated by a :app:`Pyramid` scaffold assumes that you will be using +The code generated by a :app:`Pyramid` cookiecutter assumes that you will be using the ``pserve`` command to start your application while you do development. ``pserve`` is a command that reads a :term:`PasteDeploy` ``.ini`` file (e.g., ``development.ini``), and configures a server to serve a :app:`Pyramid` @@ -1020,7 +1070,7 @@ application based on the data in the file. application. As we saw in :ref:`firstapp_chapter`, ``pserve`` needn't be invoked at all to run a :app:`Pyramid` application. The use of ``pserve`` to run a :app:`Pyramid` application is purely conventional based on the output of -its scaffolding. But we strongly recommend using ``pserve`` while developing +its cookiecutter. But we strongly recommend using ``pserve`` while developing your application because many other convenience introspection commands (such as ``pviews``, ``prequest``, ``proutes``, and others) are also implemented in terms of configuration availability of this ``.ini`` file format. It also @@ -1032,7 +1082,7 @@ restarting of the server when code changes. Using an Alternate WSGI Server ------------------------------ -Pyramid scaffolds generate projects which use the :term:`Waitress` WSGI server. +Pyramid cookiecutters generate projects which use the :term:`Waitress` WSGI server. Waitress is a server that is suited for development and light production usage. It's not the fastest nor the most featureful WSGI server. Instead, its main feature is that it works on all platforms that Pyramid needs to run on, -- cgit v1.2.3 From 2afc74b72502a6ff5594ccb2e77e5ee427bee2ac Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 27 Dec 2016 02:39:42 -0800 Subject: tutorials/modwsgi/index - update for cookiecutters --- docs/tutorials/modwsgi/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/tutorials/modwsgi/index.rst b/docs/tutorials/modwsgi/index.rst index c66786b11..568620917 100644 --- a/docs/tutorials/modwsgi/index.rst +++ b/docs/tutorials/modwsgi/index.rst @@ -73,7 +73,7 @@ specific path information for commands and files. The first argument to ``get_app`` is the project configuration file name. It's best to use the ``production.ini`` file provided by your - scaffold, as it contains settings appropriate for + cookiecutter, as it contains settings appropriate for production. The second is the name of the section within the .ini file that should be loaded by ``mod_wsgi``. The assignment to the name ``application`` is important: mod_wsgi requires finding such an -- cgit v1.2.3 From af33f7133018b8821597cb885ea5c03f225ab77c Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 27 Dec 2016 02:42:48 -0800 Subject: glossary - moar updates for cookiecutters --- docs/designdefense.rst | 2 +- docs/glossary.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/designdefense.rst b/docs/designdefense.rst index 5f65671bb..0a72ff27d 100644 --- a/docs/designdefense.rst +++ b/docs/designdefense.rst @@ -591,7 +591,7 @@ extensibility because it must be deployed in multiple locations. Pyramid Is Too Big ------------------ -"The :app:`Pyramid` compressed tarball is larger than 2MB. It must beenormous!" +"The :app:`Pyramid` compressed tarball is larger than 2MB. It must be enormous!" No. We just ship it with docs, test code, and scaffolding. Here's a breakdown of what's included in subdirectories of the package tree: diff --git a/docs/glossary.rst b/docs/glossary.rst index 35d35740d..cd63c5c67 100644 --- a/docs/glossary.rst +++ b/docs/glossary.rst @@ -992,7 +992,7 @@ Glossary pages rendered by your application, displaying request, routing, and database information. :mod:`pyramid_debugtoolbar` is configured into the ``development.ini`` of all applications which use a Pyramid - :term:`scaffold`. For more information, see + :term:`cookiecutter`. For more information, see http://docs.pylonsproject.org/projects/pyramid_debugtoolbar/en/latest/. scaffold @@ -1063,7 +1063,7 @@ Glossary Waitress A :term:`WSGI` server that runs on UNIX and Windows under Python 2.6+ - and Python 3.2+. Projects generated via Pyramid scaffolding use + and Python 3.2+. Projects generated via Pyramid cookiecutters use Waitress as a WGSI server. See http://docs.pylonsproject.org/projects/waitress/en/latest/ for detailed information. -- cgit v1.2.3 From d5b5d0829ccab21d8eeb24cb0be54c62cb5ebf80 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 27 Dec 2016 02:44:48 -0800 Subject: quicktour - moar updates for cookiecutters --- docs/quick_tour.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/quick_tour.rst b/docs/quick_tour.rst index 186cab29e..053846276 100644 --- a/docs/quick_tour.rst +++ b/docs/quick_tour.rst @@ -116,7 +116,7 @@ part of a web application, web developers need a robust, mature set of software for web requests. Pyramid has always fit nicely into the existing world of Python web development -(virtual environments, packaging, scaffolding, one of the first to embrace +(virtual environments, packaging, cookiecutters, one of the first to embrace Python 3, etc.). Pyramid turned to the well-regarded :term:`WebOb` Python library for request and response handling. In our example above, Pyramid hands ``hello_world`` a ``request`` that is :ref:`based on WebOb `. @@ -547,7 +547,7 @@ Let's look at ``pserve`` and configuration in more depth. .. seealso:: See also: :ref:`Quick Tutorial Cookiecutters `, :ref:`project_narr`, and - :doc:`../narr/scaffolding` + :doc:`../narr/cookiecutters` Application running with ``pserve`` =================================== @@ -613,7 +613,7 @@ We have a few decisions made for us in this configuration: #. *Interfaces:* ``listen = 127.0.0.1:6543 [::1]:6543`` tells ``waitress`` to listen on all interfaces on port 6543 for both IPv4 and IPv6. -Additionally the ``development.ini`` generated by this scaffold wired up +Additionally the ``development.ini`` generated by this cookiecutter wired up Python's standard logging. We'll now see in the console, for example, a log on every request that comes in, as well as traceback information. @@ -893,7 +893,7 @@ database with tables. Let's run it, then start the application: $ $VENV/bin/pserve development.ini The ORM eases the mapping of database structures into a programming language. -SQLAlchemy uses "models" for this mapping. The scaffold generated a sample +SQLAlchemy uses "models" for this mapping. The cookiecutter generated a sample model: .. literalinclude:: quick_tour/sqla_demo/sqla_demo/models/mymodel.py -- cgit v1.2.3 From 8e09458231e1f3431ba3d138f36406f41af7a766 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 27 Dec 2016 02:45:01 -0800 Subject: latexindex - update for cookiecutters --- docs/latexindex.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/latexindex.rst b/docs/latexindex.rst index a1e70425a..0a6b3400f 100644 --- a/docs/latexindex.rst +++ b/docs/latexindex.rst @@ -78,6 +78,7 @@ Narrative Documentation narr/extending narr/advconfig narr/extconfig + narr/cookiecutters narr/scaffolding narr/upgrading narr/threadlocals -- cgit v1.2.3 From b52d1a2b799a425b3f8d6c9faeb3299976fce09b Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 27 Dec 2016 02:51:18 -0800 Subject: quick_tutorial - moar updates for cookiecutters --- docs/quick_tutorial/databases.rst | 2 +- docs/quick_tutorial/ini.rst | 2 +- docs/quick_tutorial/logging.rst | 2 +- docs/quick_tutorial/request_response.rst | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/quick_tutorial/databases.rst b/docs/quick_tutorial/databases.rst index c8d87c180..87f2703c7 100644 --- a/docs/quick_tutorial/databases.rst +++ b/docs/quick_tutorial/databases.rst @@ -21,7 +21,7 @@ storage and retrieval for the wiki pages in the previous step. .. note:: - The ``alchemy`` scaffold is really helpful for getting an SQLAlchemy + The ``pyramid-cookiecutter-alchemy`` cookiecutter is really helpful for getting an SQLAlchemy project going, including generation of the console script. Since we want to see all the decisions, we will forgo convenience in this tutorial, and wire it up ourselves. diff --git a/docs/quick_tutorial/ini.rst b/docs/quick_tutorial/ini.rst index 9a65d66d1..96dfc5b5f 100644 --- a/docs/quick_tutorial/ini.rst +++ b/docs/quick_tutorial/ini.rst @@ -136,7 +136,7 @@ Extra credit .. seealso:: :ref:`project_narr`, - :ref:`scaffolding_chapter`, + :ref:`cookiecutters`, :ref:`what_is_this_pserve_thing`, :ref:`environment_chapter`, :ref:`paste_chapter` diff --git a/docs/quick_tutorial/logging.rst b/docs/quick_tutorial/logging.rst index cbbf7860e..0a530e91f 100644 --- a/docs/quick_tutorial/logging.rst +++ b/docs/quick_tutorial/logging.rst @@ -15,7 +15,7 @@ It's important to know what is going on inside our web application. In development we might need to collect some output. In production, we might need to detect problems when other people use the site. We need *logging*. -Fortunately Pyramid uses the normal Python approach to logging. The scaffold +Fortunately Pyramid uses the normal Python approach to logging. The project generated in your ``development.ini`` has a number of lines that configure the logging for you to some reasonable defaults. You then see messages sent by Pyramid, for example, when a new request comes in. diff --git a/docs/quick_tutorial/request_response.rst b/docs/quick_tutorial/request_response.rst index 0ac9b4f6d..ece8cdd6f 100644 --- a/docs/quick_tutorial/request_response.rst +++ b/docs/quick_tutorial/request_response.rst @@ -26,7 +26,7 @@ part of a web application, web developers need a robust, mature set of software for web requests and returning web responses. Pyramid has always fit nicely into the existing world of Python web development -(virtual environments, packaging, scaffolding, first to embrace Python 3, and +(virtual environments, packaging, cookiecutters, first to embrace Python 3, and so on). Pyramid turned to the well-regarded :term:`WebOb` Python library for request and response handling. In our example above, Pyramid hands ``hello_world`` a ``request`` that is :ref:`based on WebOb `. -- cgit v1.2.3 From 72a96e2cb94428bc6ae40048435f0af87703aedf Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 27 Dec 2016 02:53:23 -0800 Subject: narr/startup - update for cookiecutters --- docs/narr/startup.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index 1be8037a3..1c2b7c492 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -50,7 +50,7 @@ Here's a high-level time-ordered overview of what happens when you press application or a pipeline, you're using a "composite" (e.g., ``[composite:main]``), refer to the documentation for that particular composite to understand how to make it refer to your :app:`Pyramid` - application. In most cases, a Pyramid application built from a scaffold + application. In most cases, a Pyramid application built from a cookiecutter will have a single ``[app:main]`` section in it, and this will be the application served. -- cgit v1.2.3 From af098b66c60b2451d6e9e932d5b4bddfaa63f323 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 27 Dec 2016 02:53:56 -0800 Subject: narr/webob - update for cookiecutters --- docs/narr/webob.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/narr/webob.rst b/docs/narr/webob.rst index ce1586834..578fdeb51 100644 --- a/docs/narr/webob.rst +++ b/docs/narr/webob.rst @@ -345,8 +345,8 @@ against your ``mypackage`` package during application initialization. .. note:: This is only an example. In particular, it is not necessary to cause - ``DBSession.remove`` to be called in an application generated from any - :app:`Pyramid` scaffold, because these all use the ``pyramid_tm`` package. + ``DBSession.remove`` to be called in an application generated from a + :app:`Pyramid` cookiecutter, because these all use the ``pyramid_tm`` package. The cleanup done by ``DBSession.remove`` is unnecessary when ``pyramid_tm`` :term:`middleware` is configured into the application. -- cgit v1.2.3 From fb77c9006eda49c144203a1474fcbeed2fea55cb Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 27 Dec 2016 03:00:09 -0800 Subject: quick_tutorial - refactor MyProject/myproject for cookiecutters --- docs/narr/logging.rst | 6 +++--- docs/narr/paste.rst | 22 +++++++++++----------- docs/narr/startup.rst | 6 +++--- docs/narr/testing.rst | 12 ++++++------ 4 files changed, 23 insertions(+), 23 deletions(-) (limited to 'docs') diff --git a/docs/narr/logging.rst b/docs/narr/logging.rst index ec3590e62..87682158b 100644 --- a/docs/narr/logging.rst +++ b/docs/narr/logging.rst @@ -50,7 +50,7 @@ Default logging configuration is provided in both the default ``development.ini`` and the ``production.ini`` files. If you use ``pyramid-cookiecutter-starter`` to generate a Pyramid project with the name of the package as ``hello_world``, then the logging configuration in the ``development.ini`` file is as follows: -.. literalinclude:: MyProject/development.ini +.. literalinclude:: myproject/development.ini :language: ini :lineno-match: :lines: 29- @@ -253,14 +253,14 @@ translogger and your application in it. For instance, change from this: .. code-block:: ini [app:main] - use = egg:MyProject + use = egg:myproject To this: .. code-block:: ini [app:mypyramidapp] - use = egg:MyProject + use = egg:myproject [filter:translogger] use = egg:Paste#translogger diff --git a/docs/narr/paste.rst b/docs/narr/paste.rst index a3f1b866e..2d4e76e24 100644 --- a/docs/narr/paste.rst +++ b/docs/narr/paste.rst @@ -40,25 +40,25 @@ Entry Points and PasteDeploy ``.ini`` Files In the :ref:`project_narr` chapter, we breezed over the meaning of a configuration line in the ``deployment.ini`` file. This was the ``use = -egg:MyProject`` line in the ``[app:main]`` section. We breezed over it because +egg:myproject`` line in the ``[app:main]`` section. We breezed over it because it's pretty confusing and "too much information" for an introduction to the system. We'll try to give it a bit of attention here. Let's see the config file again: -.. literalinclude:: MyProject/development.ini +.. literalinclude:: myproject/development.ini :language: ini :linenos: -The line in ``[app:main]`` above that says ``use = egg:MyProject`` is actually -shorthand for a longer spelling: ``use = egg:MyProject#main``. The ``#main`` +The line in ``[app:main]`` above that says ``use = egg:myproject`` is actually +shorthand for a longer spelling: ``use = egg:myproject#main``. The ``#main`` part is omitted for brevity, as ``#main`` is a default defined by PasteDeploy. -``egg:MyProject#main`` is a string which has meaning to PasteDeploy. It points +``egg:myproject#main`` is a string which has meaning to PasteDeploy. It points at a :term:`setuptools` :term:`entry point` named ``main`` defined in the -``MyProject`` project. +``myproject`` project. Take a look at the generated ``setup.py`` file for this project. -.. literalinclude:: MyProject/setup.py +.. literalinclude:: myproject/setup.py :language: python :linenos: @@ -66,18 +66,18 @@ Note that ``entry_points`` is assigned a string which looks a lot like an ``.ini`` file. This string representation of an ``.ini`` file has a section named ``[paste.app_factory]``. Within this section, there is a key named ``main`` (the entry point name) which has a value ``myproject:main``. The -*key* ``main`` is what our ``egg:MyProject#main`` value of the ``use`` section +*key* ``main`` is what our ``egg:myproject#main`` value of the ``use`` section in our config file is pointing at, although it is actually shortened to -``egg:MyProject`` there. The value represents a :term:`dotted Python name` +``egg:myproject`` there. The value represents a :term:`dotted Python name` path, which refers to a callable in our ``myproject`` package's ``__init__.py`` module. -The ``egg:`` prefix in ``egg:MyProject`` indicates that this is an entry point +The ``egg:`` prefix in ``egg:myproject`` indicates that this is an entry point *URI* specifier, where the "scheme" is "egg". An "egg" is created when you run ``setup.py install`` or ``setup.py develop`` within your project. In English, this entry point can thus be referred to as a "PasteDeploy -application factory in the ``MyProject`` project which has the entry point +application factory in the ``myproject`` project which has the entry point named ``main`` where the entry point refers to a ``main`` function in the ``mypackage`` module". Indeed, if you open up the ``__init__.py`` module generated within any cookiecutter-generated package, you'll see a ``main`` diff --git a/docs/narr/startup.rst b/docs/narr/startup.rst index 1c2b7c492..cf4612602 100644 --- a/docs/narr/startup.rst +++ b/docs/narr/startup.rst @@ -70,7 +70,7 @@ Here's a high-level time-ordered overview of what happens when you press :app:`Pyramid` :term:`router` instance. Here's the contents of an example ``__init__.py`` module: - .. literalinclude:: MyProject/myproject/__init__.py + .. literalinclude:: myproject/myproject/__init__.py :language: python :linenos: @@ -86,12 +86,12 @@ Here's a high-level time-ordered overview of what happens when you press Our generated ``development.ini`` file looks like so: - .. literalinclude:: MyProject/development.ini + .. literalinclude:: myproject/development.ini :language: ini :linenos: In this case, the ``myproject.__init__:main`` function referred to by the - entry point URI ``egg:MyProject`` (see :ref:`MyProject_ini` for more + entry point URI ``egg:myproject`` (see :ref:`myproject_ini` for more information about entry point URIs, and how they relate to callables) will receive the key/value pairs ``{pyramid.reload_templates = true, pyramid.debug_authorization = false, pyramid.debug_notfound = false, diff --git a/docs/narr/testing.rst b/docs/narr/testing.rst index 354a462d4..406383bbd 100644 --- a/docs/narr/testing.rst +++ b/docs/narr/testing.rst @@ -370,11 +370,11 @@ coverage reports. Regardless of which testing :term:`package` you use, be sure to add a ``tests_require`` dependency on that package to your application's ``setup.py`` -file. Using the project ``MyProject`` generated by the starter scaffold as +file. Using the project ``myproject`` generated by the starter cookiecutter as described in :doc:`project`, we would insert the following code immediately -following the ``requires`` block in the file ``MyProject/setup.py``. +following the ``requires`` block in the file ``myproject/setup.py``. -.. literalinclude:: MyProject/setup.py +.. literalinclude:: myproject/setup.py :language: python :linenos: :lines: 11-22 @@ -383,7 +383,7 @@ following the ``requires`` block in the file ``MyProject/setup.py``. Remember to change the dependency. -.. literalinclude:: MyProject/setup.py +.. literalinclude:: myproject/setup.py :language: python :linenos: :lines: 40-44 @@ -401,14 +401,14 @@ In your ``MyPackage`` project, your :term:`package` is named ``myproject`` which contains a ``views`` module, which in turn contains a :term:`view` function ``my_view`` that returns an HTML body when the root URL is invoked: - .. literalinclude:: MyProject/myproject/views.py + .. literalinclude:: myproject/myproject/views.py :linenos: :language: python The following example functional test demonstrates invoking the above :term:`view`: - .. literalinclude:: MyProject/myproject/tests.py + .. literalinclude:: myproject/myproject/tests.py :linenos: :pyobject: FunctionalTests :language: python -- cgit v1.2.3 From d81ed38b00b922dc597b676fb39ce7225583e464 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 27 Dec 2016 03:00:38 -0800 Subject: replace pcreate with pserve --- docs/typographical-conventions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/typographical-conventions.rst b/docs/typographical-conventions.rst index 58aaff332..5efc49682 100644 --- a/docs/typographical-conventions.rst +++ b/docs/typographical-conventions.rst @@ -83,7 +83,7 @@ Windows commands are prefixed with a drive letter with an optional directory nam .. code-block:: doscon - c:\> %VENV%\Scripts\pcreate -s starter MyProject + c:\> %VENV%\Scripts\pserve development.ini cfg: -- cgit v1.2.3 From c66842cdc7070758c5b7bd7b89348fa641d456f4 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 27 Dec 2016 03:06:06 -0800 Subject: narr/commandline - update for cookiecutters --- docs/narr/commandline.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/narr/commandline.rst b/docs/narr/commandline.rst index 242bc7ec7..98663cca6 100644 --- a/docs/narr/commandline.rst +++ b/docs/narr/commandline.rst @@ -839,7 +839,7 @@ In general, you can make your script into a console script by doing the following: - Use an existing distribution (such as one you've already created via - ``pcreate``) or create a new distribution that possesses at least one package + ``cookiecutter``) or create a new distribution that possesses at least one package or module. It should, within any module within the distribution, house a callable (usually a function) that takes no arguments and which runs any of the code you wish to run. -- cgit v1.2.3 From b648effe2371f8fdb75c2c4317ef828360bd964a Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 27 Dec 2016 03:07:29 -0800 Subject: undo update for tutorials/modwsgi - This requires changes with virtual environments, pcreate, and possibly configuration files. Deferring. --- docs/tutorials/modwsgi/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/tutorials/modwsgi/index.rst b/docs/tutorials/modwsgi/index.rst index 568620917..c66786b11 100644 --- a/docs/tutorials/modwsgi/index.rst +++ b/docs/tutorials/modwsgi/index.rst @@ -73,7 +73,7 @@ specific path information for commands and files. The first argument to ``get_app`` is the project configuration file name. It's best to use the ``production.ini`` file provided by your - cookiecutter, as it contains settings appropriate for + scaffold, as it contains settings appropriate for production. The second is the name of the section within the .ini file that should be loaded by ``mod_wsgi``. The assignment to the name ``application`` is important: mod_wsgi requires finding such an -- cgit v1.2.3 From 7d16c02d9d1a4c1fd230d7d6a44517e75eb4ae2b Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 27 Dec 2016 12:49:03 -0800 Subject: update Sphinx link target --- docs/narr/install.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/narr/install.rst b/docs/narr/install.rst index 10173aec8..ee1808b01 100644 --- a/docs/narr/install.rst +++ b/docs/narr/install.rst @@ -111,7 +111,7 @@ following options: You might also need to download and install the Python for Windows extensions. .. seealso:: See the official Python documentation :ref:`Using Python on - Windows ` for full details. + Windows ` for full details. .. seealso:: Download and install the `Python for Windows extensions `_. Carefully read -- cgit v1.2.3 From 43549fb2a3cbe915d8c727cd680e94389532d2e1 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Wed, 28 Dec 2016 13:47:10 -0800 Subject: fix link target --- docs/narr/install.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/narr/install.rst b/docs/narr/install.rst index ee1808b01..10173aec8 100644 --- a/docs/narr/install.rst +++ b/docs/narr/install.rst @@ -111,7 +111,7 @@ following options: You might also need to download and install the Python for Windows extensions. .. seealso:: See the official Python documentation :ref:`Using Python on - Windows ` for full details. + Windows ` for full details. .. seealso:: Download and install the `Python for Windows extensions `_. Carefully read -- cgit v1.2.3 From b867c82ee8f502ed239a3efa3d5c03685b58c569 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 1 Jan 2017 10:48:42 -0800 Subject: Remove notes about cookiecutter installation, as they now remove sudo for most systems --- docs/tutorials/wiki/installation.rst | 4 ---- docs/tutorials/wiki2/installation.rst | 4 ---- 2 files changed, 8 deletions(-) (limited to 'docs') diff --git a/docs/tutorials/wiki/installation.rst b/docs/tutorials/wiki/installation.rst index b99196474..6cd7fbbc2 100644 --- a/docs/tutorials/wiki/installation.rst +++ b/docs/tutorials/wiki/installation.rst @@ -19,10 +19,6 @@ Install cookiecutter -------------------- We will use a :term:`cookiecutter` to create a Python package project from a Python package project template. See `Cookiecutter Installation `_ for instructions. -.. note:: - - At the time of writing, the installation instructions for Cookiecutter suggest the optional use of ``sudo``, implying to install it in the system Python. We suggest that you install it in a virtual environment instead. - Generate a Pyramid project from a cookiecutter ---------------------------------------------- diff --git a/docs/tutorials/wiki2/installation.rst b/docs/tutorials/wiki2/installation.rst index 2142a0c0c..794566985 100644 --- a/docs/tutorials/wiki2/installation.rst +++ b/docs/tutorials/wiki2/installation.rst @@ -31,10 +31,6 @@ Install cookiecutter -------------------- We will use a :term:`cookiecutter` to create a Python package project from a Python package project template. See `Cookiecutter Installation `_ for instructions. -.. note:: - - At the time of writing, the installation instructions for Cookiecutter suggest the optional use of ``sudo``, implying to install it in the system Python. We suggest that you install it in a virtual environment instead. - Generate a Pyramid project from a cookiecutter ---------------------------------------------- -- cgit v1.2.3 From a36d33bf7872575fb79cdc0e5959a62b30df5742 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Mon, 2 Jan 2017 17:18:12 -0800 Subject: Waitress dropped 2.6 and 3.2 support --- docs/glossary.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/glossary.rst b/docs/glossary.rst index cd63c5c67..b4673f73e 100644 --- a/docs/glossary.rst +++ b/docs/glossary.rst @@ -1062,8 +1062,8 @@ Glossary :class:`pyramid.interfaces.IAssetDescriptor`. Waitress - A :term:`WSGI` server that runs on UNIX and Windows under Python 2.6+ - and Python 3.2+. Projects generated via Pyramid cookiecutters use + A :term:`WSGI` server that runs on UNIX and Windows under Python 2.7+ + and Python 3.3+. Projects generated via Pyramid cookiecutters use Waitress as a WGSI server. See http://docs.pylonsproject.org/projects/waitress/en/latest/ for detailed information. -- cgit v1.2.3