Facebook SDK For Python Deprecated

Yesterday Facebook without a notice or warning decided it to delete their SDK github repo for Python. Today the repo is back online but with a notice saying that they have no plans to update it anymore. I’ve been seeing this coming since they stop adding new features awhile ago. So anyways there’s an alternative [...]

UUID Objects in Pylons with SQLAlchemy

Recently I had to generate and store uuid objects into a Postgres database, but to my surprise SQLAlchemy kept showing the following error: sqlalchemy.exc.ProgrammingError: (ProgrammingError) can’t adapt type ‘UUID’ So the solution was that I had to change my field type from varchar to uuid on my Postgres database, import the psycopg2 extras functions and [...]

Implementing a text based captcha in Pylons

One of the must have elements on any html form as an anti-spam measure is a captcha, and the captcha technique that has worked pretty well for me is text based. So here’s how to implement one. Create a controller and name it captcha ~$ paster controller captcha Add this function to your helpers.py file [...]

HTML lists with jQuery for mobile devices

Recently I had to transform a group of li elements into an accordion for a mobile version of a client website. So this is what I came up with. I had an html that looked like this <ul> <li><span>Category1</span> <ul> <li>Subcategory1</li> <li>Subcategory2</li> </ul> </li> <li><span>Category2</span> <ul> <li>Subcategory</li> <li>Subcategory1</li> </ul> </li>   </ul> And I wanted [...]

Pylons and Twitter Based Authorization

Implementing Twitter authorization in Pylons is easy as butter, I will show you how to do it in the next steps. Download python-twitter and install it https://code.google.com/p/python-twitter python setup.py build python setup.py install Download and install dependencies https://github.com/simplegeo/python-oauth2 http://code.google.com/p/httplib2/ http://cheeseshop.python.org/pypi/simplejson Now you’re almost there. There’s a file called get_access_token.py that you need to call in [...]

Android SDK and Local Testing

It’s been awhile since I installed the Android SDK, today I’m starting a new android app so I updated to the latest version. To my surprise the tools have moved to different folders so just as I was ready to start testing locally I couldn’t find adb (adroid debugger bridge) in the tools folder, turns [...]

Paste Server init script in Debian

This past few months I’ve set up a few beta projects on a single Debian server, and now it has become a tedious task typing the command to start|restart|stop paste for each project everytime I push new code. So I decide it to create a init script to simplify things. For this I’ve my virtual [...]

Host Email with Postfix, Dovecot and Postgres on Debian 6 (Squeeze)

Recently I had to configure a web server from scratch, which I haven’t done in a while. So I took a look at the guides from my current hosting provider Linode. They have a guide covering debian 5 (Lenny) which is basically the same for debian 6 (squeeze). To make this a bit more exciting [...]

repoze.what with reflected tables using SQLAlchemy in Pylons

One of the many things I like about SQLAlchemy is the feature of reflected tables, this means I can develop dashboards for existing applications with my current favorite framework(Pylons). So I had to create an authorization mechanism for my dashboard and this recipeĀ from the Pylons cookbook was just what I needed. The only thing I [...]

Nginx, uWSGI, Pylons and the double slash problem

So there I am, deploying my first Pylons based app and thinking on which WSGI interface to go with. At the end I decided to go with uWSGI it has been proven to be a beast at handling requests even on high loads. I setup my Nginx conf file, fired up uWSGI and found out [...]