First CherryPy 2 alpha release out

The first public alpha release of CherryPy2 was made available yesterday. It represents a step away from extensions to the Python language and includes no “toy code”. Because of this, the compilation step is no longer necessary and no modifications have to be done to make current Python editors correctly colorize the code and build browsable code trees.

After you have downloaded the CherryPy2 alpha available from the
CherryPy website, unpack it to a temporary directory. Then, assuming you already have a recent version of Python installed on your computer:

  1. Open a shell (Konsole, Bash, Dos, whatever you have)
  2. Navigate to the temporary directory
  3. Type python setup.py install

Now, the cherrypy module should be installed into your $PYTHON/Lib/site-packages directory. (Edit: It might be $PYTHON/site-packages, depends on OS) Go there and open the tutorials directory. To run a tutorial, do the following

  1. Execute a tutorial script (type python tutorial1.py in a shell f.ex.)
  2. Open a web browser and point it to http://localhost:8080
  3. Play with it
  4. Open the tutorial1.py file in an your favorite Python editor and inspect the code.
    The tutorial files are well commented so it’s easy to understand what is happening.

There’s a small error in the 2 bonus tutorials, they try to import CherryPy.
Just change that to import cherrypy and run.

The templating system that has been built into CherryPy is also released as a pure Python module to go along with CherryPy2 or any other web framework. It’s now called CherryTemplate.

Comments are closed.