Source

Akhet / docs / usage.rst

Usage

Creating a Pyramid/Akhet application

Here are the basic steps to install Pyramid and Akhet, create a virtualenv and activate it, create an application, and run it so you can see it in the browser.

  • Line 1 creates the virtualenv. "--no-site-packages" is recommended with Pyramid. Why
  • Line 5 creates application "Zzz" based on the 'alchemy' scaffold. (For Pyramid 1.2 and earlier, use "paster create -t routesalchemy Zzz" instead.)
  • Line 7 generates the package metadata (the Zzz.egg-info directory). Remember to do this whenever you add or delete files in the package.
  • Line 8 launches the server using the configuration file "development.ini". (For Pyramid 1.2 and earlier, use "paster serve development.ini" instead.)

See the Installing Pyramid chapter in the Pyramid manual if any of this is unfamiliar.

Throughout this manual we'll use "Zzz" for your application's name, and zzz for the top-level Python module in the application.

See Uninstalling if you want to uninstall things later.

Using development versions

Akhet's development version works like most Python source repositories. Pyramid's development version requires additional work to install.

(myvenv)$ git clone git://github.com/Pylons/pyramid Pyramid
(myvenv)$ pip install setuptools-git
(myvenv)$ pip install -e ./Pyramid
(myvenv)$ hg clone http://bitbucket.org/sluggo/akhet Akhet
(myvenv)$ pip install -e ./Akhet

Three things to note here:

  • Pyramid requires 'setuptools-git' because the repsository contains Git submodules.
  • Pyramid must be installed as a link (with "-e") because the repository does not contain a MANIFEST.in file, so a regular install wouldn't copy the scaffolds or other supplemental files.
  • Install Pyramid before Akhet in order to satisfy the dependency. Otherwise installing Akhet would download the latest stable Pyramid from PyPI.

The "p" commands

Pyramid 1.3 includes the following command-line utilities:

  • pcreate: Create a new application using a scaffold.
  • pserve: Launch an application and server based on an INI configuration file.
  • proutes: List all routes in an application.
  • pviews: List all views in an application.
  • pshell: An interactive Python shell preloaded with your application environment.
  • ptweens: List all tweens.