*2009.09.20 11:46:27 python pylons new_pylons_app test server

paster serve --reload development.ini

view in firefox: | http://localhost:5000/

if no controller has been created, will get a 404

 

*2009.09.20 11:43:11 python pylons new_pylons_app templates

remove public index.html (otherwise it will be default) cd (package)/public #rm index.html bg.png pylons-logo.gif hg rm personnel/public/bg.png hg rm personnel/public/pylons-logo.gif hg rm personnel/public/index.html

#make images and css directories in public: cp -R /c/external/sites/charlesbrandt.com/templates/pylons/public/css public/ #import other default template files: cp -R /c/external/sites/charlesbrandt.com/templates/pylons/templates/* templates/ cp -R /c/external/sites/charlesbrandt.com/templates/pylons/controllers/* controllers/

#be sure to choose if you want the sqlalchemy version (model-sa) or non-sa: cp /c/external/sites/charlesbrandt.com/templates/pylons/model/* model/

update the imports in the controllers you plan to use

update lib/helpers.py to import webhelpers cp /c/external/sites/charlesbrandt.com/templates/pylons/lib/* lib/

 

*2009.09.20 11:39:14 python pylons new_pylons_app

sudo easy_install virtualenv

 

*2009.03.31 15:48:33 python pylons new_pylons_app database

make sure model files have been created cp ../personnel-try1/personnel/model/__init__.py personnel/model/

paster setup-app development.ini

#make sure development.ini is using an open port: vi development.ini

 

*2009.03.31 15:18:54 python pylons new_pylons_app routes

update routes

 

*2009.03.31 14:31:58 python pylons new_pylons_app install egg

python setup.py develop

 

*2009.03.31 13:32:52 python pylons new_pylons_app intialize

virtualenv --no-site-packages personnel-virtual

cd personnel-virtual

source bin/activate

easy_install pylons easy_install formalchemy

 

*2009.03.31 13:07:52 python pylons new_pylons_app

paster create -t pylons_fa

cd personnel

hg init cp ../.hgignore .

hg add hg ci -m "new repo for new project"

 

*2008.09.15 20:38 python pylons new_pylons_app models persistence sqlalchemy

forms are closely related to models

you'll need a way to persist the data.

if it's not tied to a specific directory of content, then it should probably be stored in a database of sorts to allow data lookup.

with pylons that probably means using sqlalchemy

if you didn't enable it in your project to begin with, you'll need to do so now following: | http://wiki.pylonshq.com/display/pylonsdocs/Using+SQLAlchemy+with+Pylons

set up meta.py set up model

init_model in __init

configure database string in config (development.ini) sqlalchemy.url = sqlite:///%(here)s/jb-dev.sqlite

environment.py websetup.py

don't forget! paster setup-app development.ini

 

*2008.09.15 13:44 python pylons new_pylons_app forms

to start working with forms, you will new to add methods to a class... one to show the form, one to handle the form.

you will also need to import the validate code. (formencode)

layouts and other form validation can be stored with other model code (I'm torn if that is more UI or model validation... pylons seems to go with model validation).

Pylons comes with an easy to use validate decorator, imported by default in your lib/base.py. Using it in your controller is pretty straight-forward:

#this gets the validate decorator. from pylons.decorators import *

 

*2008.09.11 18:02 python pylons new_pylons_app controllers

paster controller name-of-new-controller

start with a main controller:

for simple sites this may be enough. (i.e. sites with only one level deep) for these sites it seems like over kill to make a separate controller for each page if there is really only an index page for each one.

It may be adequate to stick with a template system (i.e. manual static, sphynx, webby) for a simple site. On the other hand, if you're comfortable with python and needs grow in the future, it is nice to have a framework in place. Pylons doesn't add a lot of bloat to even a simple site. A framework keeps things consistent across projects.