Showing posts with label Google App Engine. Show all posts
Showing posts with label Google App Engine. Show all posts

Sunday, December 5, 2010

Two simple steps to reduce bandwidth on static files

First step is to let Google host your JavaScript library of choice for you. Google Libraries API hosts JQuery, Mootools, Prototype... and you can directly link to them from your website.

More info at:
http://code.google.com/apis/libraries/devguide.html

Second step is to compress you CSS file (or files, but if you are gonna compress it to save bandwidth, probably you want to merge them in one for better performance). There are several websites which compress CSS files online, and for free. The one I found which works best is:
http://www.lotterypost.com/css-compress.aspx

Saturday, December 4, 2010

Debugging with PDB and App Engine

Python debugger (pdb) doesn't work on App Engine SDK as usual. After adding to my project:


import pdb; pdb.set_trace()


I got:


Blocking access to skipped file "/.pdbrc"

File "/usr/lib/python2.6/bdb.py", line 46, in trace_dispatch
return self.dispatch_line(frame)
File "/usr/lib/python2.6/bdb.py", line 65, in dispatch_line
if self.quitting: raise BdbQuit


But, as posted in morethanseven, it's easy to make it work using:


import pdb
import sys
for attr in ('stdin', 'stdout', 'stderr'):
setattr(sys, attr, getattr(sys, '__%s__' % attr))
pdb.set_trace()