2009/12 31
Env:
Python 2.5
Ubuntu

1. Install paste
sudo easy_install-2.5 paste


2. Install pylons
sudo easy_install-2.5 Pylons


3. install SQLAlchemy if you'd like to use
sudo easy_install-2.5 SQLAlchemy


4. create a pylons project:
paster create --template=pylons test

That will ask you two questions:

Enter template_engine (mako/genshi/jinja2/etc: Template language) ['mako']: mako
Enter sqlalchemy (True/False: Include SQLAlchemy 0.5 configuration) [False]: True


5. create a deployment.ini
cd test
cp test/config/deployment.ini_tmpl test/config/deployment.ini
vi deployment.ini

modify the email_to, db setting or others to fit in with you

6. start the test server
$paster serve --reload development.ini
Starting subprocess with file monitor
Starting server in PID 12212.
serving on http://127.0.0.1:5000


You will see a pylons welcome page when you open http://127.0.0.1:5000 in your favorite browser.

7. create a new controller
paster controller hello

Visit http://127.0.0.1:5000/hello/index and you will see a text page: "Hello World"

All job done. Have your fan.

Notice: make sure you've added the version 2.5 into easy_install command when you have multiply python version in your system.
Defined tags for this entry: ,

Posted by rollenc

Last modified on 2010-01-02 14:50