| | |
| | | is a breeze. Unfortunately "standard" is not so simple in Python. For this |
| | | Quick Tour, it means `Python <https://www.python.org/downloads/>`_, :mod:`python:venv` (or `virtualenv for |
| | | Python 2.7 <https://virtualenv.pypa.io/en/stable/>`_), |
| | | `pip <https://pypi.org/project/pip/>`_, and `setuptools |
| | | `pip <https://pypi.org/project/pip/>`_, and `Setuptools |
| | | <https://pypi.org/project/setuptools/>`_. |
| | | |
| | | To save a little bit of typing and to be certain that we use the modules, |
| | |
| | | packages, no structure. Most Pyramid projects, though, aren't developed this |
| | | way. |
| | | |
| | | To ease the process of getting started, the Pylons Project provides :term:`cookiecutter`\ s that generate sample Pyramid projects from project templates. These cookiecutters will install Pyramid and its dependencies as well. |
| | | To ease the process of getting started, the Pylons Project provides a :term:`cookiecutter` that generates sample Pyramid projects from project templates. This cookiecutter will install Pyramid and its dependencies as well. |
| | | |
| | | First you'll need to install cookiecutter. |
| | | |
| | |
| | | |
| | | .. code-block:: bash |
| | | |
| | | $VENV/bin/cookiecutter gh:Pylons/pyramid-cookiecutter-starter --checkout master |
| | | $VENV/bin/cookiecutter gh:Pylons/pyramid-cookiecutter-starter --checkout 1.10-branch |
| | | |
| | | If prompted for the first item, accept the default ``yes`` by hitting return. |
| | | |
| | |
| | | 1 - jinja2 |
| | | 2 - chameleon |
| | | 3 - mako |
| | | Choose from 1, 2, 3 [1]: 1 |
| | | Select backend: |
| | | 1 - none |
| | | 2 - sqlalchemy |
| | | 3 - zodb |
| | | Choose from 1, 2, 3 [1]: 1 |
| | | |
| | | We then run through the following commands. |
| | |
| | | available in your browser. Adding it to your project illustrates several points |
| | | about configuration. |
| | | |
| | | The cookiecutter ``pyramid-cookiecutter-starter`` already configured our package to include the |
| | | Our cookiecutter ``pyramid-cookiecutter-starter`` already configured our package to include the |
| | | add-on ``pyramid_debugtoolbar`` in its ``setup.py``: |
| | | |
| | | .. literalinclude:: quick_tour/package/setup.py |
| | |
| | | :ref:`pyramid_debugtoolbar <toolbar:overview>` |
| | | |
| | | Unit tests and ``pytest`` |
| | | ========================== |
| | | ========================= |
| | | |
| | | Yikes! We got this far and we haven't yet discussed tests. This is particularly |
| | | egregious, as Pyramid has had a deep commitment to full test coverage since |
| | |
| | | .. code-block:: bash |
| | | |
| | | cd ~ |
| | | env/bin/cookiecutter gh:Pylons/pyramid-cookiecutter-alchemy --checkout master |
| | | env/bin/cookiecutter gh:Pylons/pyramid-cookiecutter-starter --checkout 1.10-branch |
| | | |
| | | If prompted for the first item, accept the default ``yes`` by hitting return. |
| | | |
| | | .. code-block:: text |
| | | |
| | | You've cloned ~/.cookiecutters/pyramid-cookiecutter-alchemy before. |
| | | You've cloned ~/.cookiecutters/pyramid-cookiecutter-starter before. |
| | | Is it okay to delete and re-clone it? [yes]: yes |
| | | project_name [Pyramid Scaffold]: sqla_demo |
| | | repo_name [sqla_demo]: sqla_demo |
| | | Select template_language: |
| | | 1 - jinja2 |
| | | 2 - chameleon |
| | | 3 - mako |
| | | Choose from 1, 2, 3 [1]: 1 |
| | | Select backend: |
| | | 1 - none |
| | | 2 - sqlalchemy |
| | | 3 - zodb |
| | | Choose from 1, 2, 3 [1]: 2 |
| | | |
| | | We then run through the following commands as before. |
| | | |