[Chicago] help from Django and Pylons developers

Ian Bicking ianb at colorstudy.com
Mon Apr 28 20:18:06 CEST 2008

Massimo Di Pierro wrote:
> Thank you Ian,
> I think I incorporated almost all of your suggestions too although I do 
> not think that using FileApp for streaming is quite as easy as the web2py.

Perhaps not, but it is the way to do it, and it does support all those 
features, and it was factored the way it is so you could do that sort of 

> I have never a Pylons example for connecting to multiple databases. 
> Would you mind posting an example?

I'm not that familiar with the way databases are setup and configured in 
Pylons, so I'm not sure.

> About bytecode compilation. Send me a working Pylons bytecode compiled 
> application (including bytecode compiled models, views and controllers) 
> and the step you took to make it and I will believe you.

Well, I've never tried, and I don't want to bother to try because I 
think it's a silly thing to do.  There are generally applicable 
techniques for Python (like python -m compileall; find . -name '*.py' 
-exec rm {} \;).  It's possible Pylons looks for *.py files or something 
in some contexts (e.g., listing controllers), and so doesn't work with 
the source removed, so I can't say for sure if this would work by itself.

> Yes all bytecode compiled code can be decompiled (this is true for Java 
> and ASP as well) but for some people it is important. In the case of 
> web2py there are two reasons for it: 1) speed, there is no more template 
> parsing with bytecode compiled apps, 2) you are not explicitly giving 
> away the source code (if you decompile you do not get exactly the same 
> original code).

There's no speed advantage: all Python code is all bytecode compiled on 
demand.  Python does this automatically without any intervention.  Mako 
and several other templating languages replicate this behavior.  Also 
several distutils commands invoke bytecode compilation.

Ian Bicking : ianb at colorstudy.com : http://blog.ianbicking.org

More information about the Chicago mailing list