*2008.09.30 09:08 python pylons administration rename move app

Jonathan Vanasco Wed, 24 Sep 2008 08:20:09 -0700

I've had to do this before...

you'll want to rename the appropriate files / directories , and then replace all the module name instances in your project

ie: if your project is named ASDFGHJK , then you'll need to rename: /ASDFGHJK /ASDFGHJK/asdfhjk /ASDFGHJK/asdfhjk.egg-info

then do a s/ASDFGHJK/? on the files

there are lots of
import ASDFGHJK from ASDFGHJK import

if you're using a mac, TextWrangler has a great find/replace function that works on directories

if you're using subversion for version control, i generaly like to do it like this: 1- rename files 2- commit 3- find/replace text 4- commit

if you're using git or mercurial, i think you can do the commits in one step. svn needs them in two though.

 

*2008.09.22 21:23 python database
*2008.09.20 21:44 python jpeg

seems like the best way to do lossless image (jpeg) rotation in python is to use the commands jpegtrans and jhead, both open source, but command line. easy enough to wrap in a system call of sorts (subprocess.Popen)

see simple browser gallery for examples.

 

*2008.09.17 09:52 python blog_and_cms
*2008.09.16 21:09 python pylons administration

see also dreamhost pylons-deploy.txt

 

*2008.09.15 20:38 python pylons template 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 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 template forms

to start working with forms, you will new to 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.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.12 09:52 python pylons template

once you have a basic pylons instance created, there are a few things that need to be configured for most sites to get started.

This seems beyond the scope of a basic installation document, but nonetheless should be documented.

from root of project:

 

*2008.09.11 18:02 python pylons template

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.

some might argue to just stick with a templating system for a simple site, but just incase 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... so why not. Also keeps things consistent across projects.

make images and css directories in public:

remove public index.html (otherwise it will be default)

add standard templates

update routes

 

*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.

 

*2008.09.11 17:59 python google_app_engine app engine
google app engine - Google Search
Google App Engine - Google Code
Google App Engine FAQs - Google App Engine - Google Code
What Is Google App Engine? - Google App Engine - Google Code

 

*2008.09.11 10:20 python wxpython
*2008.09.11 10:18 python pyroom
*2008.09.08 09:08 python presentations
*2008.09.08 09:07 python xml
*2008.09.08 09:06 python graphs_trees_hierarchy
*2008.09.07 13:03 python turbogears
turbo gears - Google Search
TurboGears: Front-to-Back Web Development
turbo gears pylons - Google Search
TurboGears - Wikipedia, the free encyclopedia
Planet Turbogears
Turbogears now based on Pylons! - pylons-discuss | Google Groups
Contributing - TurboGears Documentation
1.0 - TurboGears Documentation
1.0/GettingStarted/BigPicture - TurboGears Documentation

 

*2008.09.04 16:41 python blog_and_cms pybloxsom
Double Dose
publish to word press via atom - Google Search
publish to wordpress via atom - Google Search
posting to wordpress via ruby and atompub « processi
python atom publish - Google Search
atomixlib: A Python Atom generator
Atom + python - SWiK
Ian Bicking: a blog :: Atom Publishing Protocol: Atompub
Atom Protocol Exerciser
amplee - deFuze.org - Trac
amplee/Tutorial-0.6.x - deFuze.org - Trac
Python Package Index : Amara 1.2.0.2
4suite.org
atom-protocol-python | Google Groups
Microblogging in Python... some ideas and code - atom-protocol-python | Google Groups
atompub - Google Search
Atom
The Atom Publishing Protocol
pybloxsom on dreamhost - Google Search
The Geekess - Linux, bicycling, open source, gardening, amateur rockets, and other seemingly unrelated hobbies.
Re: tagging for dummies?
PyBlosxom - main site
PyBlosxom - main site
PyBlosxom - main site
PyBlosxom - main site
Advogato: Personal info for murrayc
Munich Blogs

 

*2008.09.04 12:55 python md5 du stat
*2008.09.04 12:54 python open_erp
*2008.09.04 12:53 python element_tree
*2008.09.04 12:52 python element_tree
python element tree - Google Search
ElementTreeOverview
Elements and ElementTrees
XPath Support inElementTree
XML Path Language (XPath)
python hierarchical - Google Search
PyTables - Hierarchical Datasets in Python
XML Matters: Process XML in Python with ElementTree
The ElementTree iterparseFunction
The cElementTreeModule
python iterator - Google Search
3.5 Iterator Types
Property List Programming Guide for Cocoa: XML Property Lists
Namespaces in XML 1.0 (Second Edition)
XML Namespaces
Shared hosting plans - WebFaction
Python 101 -- Introduction to Python