| | |
| | | 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``. |
| | | To ease the process of getting started on a project, the Pylons Project provides a :term:`cookiecutter` that generates sample :app:`Pyramid` projects from project templates. The cookiecutter 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 |
| | |
| | | |
| | | $VENV/bin/pip install cookiecutter |
| | | |
| | | #. Let's use the cookiecutter ``pyramid-cookiecutter-theonecc`` to create a starter :app:`Pyramid` project in the current directory, entering values at the prompts as shown below for the following command. |
| | | #. 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 gh:Pylons/pyramid-cookiecutter-theonecc --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. |
| | | |
| | | .. code-block:: text |
| | | |
| | | You've cloned ~/.cookiecutters/pyramid-cookiecutter-theonecc before. |
| | | You've cloned ~/.cookiecutters/pyramid-cookiecutter-starter before. |
| | | Is it okay to delete and re-clone it? [yes]: yes |
| | | project_name [Pyramid Scaffold]: cc_starter |
| | | repo_name [cc_starter]: cc_starter |
| | |
| | | env/bin/pip install --upgrade pip setuptools |
| | | # ...and into which we install our project. |
| | | env/bin/pip install -e . |
| | | |
| | | **Note:** If you selected ``sqlalchemy`` in the preceding step, continue. Otherwise, skip to the next step. |
| | | |
| | | .. code-block:: bash |
| | | |
| | | # Generate your first revision. |
| | | env/bin/alembic -c development.ini revision --autogenerate -m "init" |
| | | # Upgrade to that revision. |
| | | env/bin/alembic -c development.ini upgrade head |
| | | # Load default data. |
| | | env/bin/initialize_cc_starter_db development.ini |
| | | |
| | | #. Start up the application by pointing :app:`Pyramid`'s ``pserve`` command at the |
| | | project's (generated) configuration file: |