Edgewall Software

Changes between Version 50 and Version 51 of GenshiTutorial


Ignore:
Timestamp:
Aug 31, 2007, 1:07:22 AM (12 years ago)
Author:
cmlenz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GenshiTutorial

    v50 v51  
    77In this tutorial we'll create a simple Python web application based on [http://cherrpy.org/ CherryPy 3]. !CherryPy was chosen because it provides a convenient level of abstraction over raw CGI or [http://wsgi.org/wsgi WSGI] development, but is less ambitious than full-stack web frameworks such as [http://pylonshq.com/ Pylons] or [http://www.djangoproject.com/ Django], which tend to come with a preferred templating language, and often show significant bias towards that language.
    88
    9 The application is a stripped-down version of sites such as [http://reddit.com/ reddit] or [http://digg.com/ digg]: it lets users submit links to online articles they find interesting, and then lets other users vote on those stories and post comments. Just for kicks, we'll call that application '''Geddit'''
    10 
    11 The project is kept as simple as possible, while still showing many of Genshi features and how to best use them:
     9The application is a stripped-down version of sites such as [http://reddit.com/ reddit] or [http://digg.com/ digg]: it lets users submit links to online articles they find interesting, and then lets other users comment on those stories. Just for kicks, we'll call that application '''Geddit'''
     10
     11We'll keep the project as simple as possible, while still showing many of Genshi features and how to best use them:
    1212 * For persistence, we'll use native Python object serialization (via the `pickle` module), instead of an SQL database and an ORM.
    1313 * There's no authentication of any kind. Anyone can submit links, anyone can comment.
     
    3232 
    3333 1. Create a directory that should contain the application
    34  1. Inside that directory create a Python package named geddit by doing the following:
     34 2. Inside that directory create a Python package named geddit by doing the following:
    3535  * Create a `geddit` directory
    3636  * Create an empty file called `__init__.py` inside the `geddit` directory
    37  1. Inside that package, create a file called `controller.py` with the following content:
     37 3. Inside the `geddit` package directory, create a file called `controller.py` with the following content:
    3838
    3939{{{
     
    5757
    5858def main(filename):
     59    data = {} # We'll replace this later
     60
    5961    # Some global configuration; note that this could be moved into a
    6062    # configuration file