AppStats for web2py

If you are running a web2py app on AppEngine it is matter of sanity to have AppStats logging your app 's performance. It is common practice to have performance monitor for all major web applications out there so that you know where to optimize your application. 

If you are on AppEngine the performance of your application is even more crucial as better performance means less costs and stability (as it is easy to hit the restrictions). 

If you have a web2py application it is very easy to this as web2py is first class wsgi citizen. Simply go to gaehander.py and modify the main function as in the following gist:

Then go to app.yaml and right after the handler definitions add these 2 lines:

In the root directory of web2py create a new a file called appengine_config.py with the following content (thanx WritersEar for pointing out):

 

And you are good to go!

Picture_2

Support for multiple query parameters with the same name in python-oauth

While working on the API of LinkedIn we had to a query in this format:

http://api.linkedin.com/v1/people/~/network?type=STAT&type=PICT&count=50&start=50

As usual, you get a 401 (forbidden) response. That was tough bug. Thank to LinkedIn forum I found out that in the python-oauth library you cannot have a query parameter with multiple values. Adam from the LinkedIn forum pointed out that have multiple values is valid according to the OAuth 1.0 spec and there is support in the python-oauth2 library.

If you want this functionality in python-oauth (OAuth 1.0) take a look at the following gist.