Your next step is to create a project. For this tutorial, we will use the
scaffold named alchemy, which generates an application
that uses SQLAlchemy and URL dispatch. Pyramid
supplies a variety of scaffolds to generate sample projects.

The below instructions assume your current working directory is the
“virtualenv” named “pyramidtut”.

On UNIX:

$ bin/pcreate -s alchemy tutorial

On Windows:

c:\pyramidtut> Scripts\pcreate -s alchemy tutorial

Note

If you are using Windows, the alchemy
scaffold may not deal gracefully with installation into a
location that contains spaces in the path. If you experience
startup problems, try putting both the virtualenv and the project
into directories that do not contain spaces in their paths.

In order to do development on the project easily, you must “register”
the project as a development egg in your workspace using the
setup.pydevelop command. In order to do so, cd to the tutorial
directory you created in Making a Project, and run the
setup.pydevelop command using the virtualenv Python interpreter.

You can run the nosetests command to see test coverage
information. This runs the tests in the same way that setup.pytest does but provides additional “coverage” information, exposing
which lines of your project are “covered” (or not covered) by the
tests.

To get this functionality working, we’ll need to install the nose and
coverage packages into our virtualenv:

On UNIX:

$ ../bin/easy_install nose coverage

On Windows:

c:\pyramidtut\tutorial> ..\Scripts\easy_install nose coverage

Once nose and coverage are installed, we can actually run the
coverage tests.

At this point, when you visit http://localhost:6543/ in your web browser,
you will see the generated application’s default page.

One thing you’ll notice is the “debug toolbar” icon on right hand side of the
page. You can read more about the purpose of the icon at
The Debug Toolbar. It allows you to get information about your
application while you develop.

you want to use ZopeTransactionExtension and pyramid_tm to scope
sessions to requests

Note

Pyramid supports any persistent storage mechanism (e.g. object
database or filesystem files, etc). It also supports an additional
mechanism to map URLs to code (traversal). However, for the
purposes of this tutorial, we’ll only be using url dispatch and
SQLAlchemy.