Category Archives: Python

Django – verbose console logging in development server

The moment you set DEBUG = False in development server for Django, you will be clueless about what’s going on for every error your application may encounter. If you just want to show verbose error messages on the console (when … Continue reading

Posted in Python | Tagged , , , | Leave a comment

Sending Email in Google AppEngine for Python

Google AppEngine provides an API services for sending emails. I’ve setup a contact form to use such feature. I used a couple of validations, security tokens via custom sessions and the mail service to implement this feature in my site. … Continue reading

Posted in Python | Tagged , , , , | Leave a comment

Sessions on Google AppEngine for Python

In PHP world, creating sessions is so easy when using built ins. To customize, secure and make it fast, you have to create a whole new architecture to do that. In my experience with Google AppEngine, your only choice is … Continue reading

Posted in Python | Tagged , , , , , | Leave a comment

Validatish – a Python validation library

I was looking for a good validation library in Python and then I found validatish. As usual, it uses exceptions every time it encounters an error. I like its simplicity and ease of use. Below is how I used it … Continue reading

Posted in Python | Tagged , , , | Leave a comment

Trival – Passing list or dictionary as argument in Python

So you got a cool API with lots of magic? Then suddenly you wanted something like dynamically passing parameters when needed. A common pattern wherein you call an arbitrary method with arbitrary arguments. I know this is trival but if … Continue reading

Posted in Python | Tagged , , | Leave a comment

Redirecting URLs in Google AppEngine for Python

A month ago, I decided to re-structure my URLs but have no plan on handling redirects for indexed URLs by search engines. I’ve been receiving several 404 errors on my logs and finally decided to do a 301 redirect to … Continue reading

Posted in Python | Tagged , , , , | Leave a comment

Re-writing lysender.com – a Google AppEngine Python adventure

My portfolio site is definitely a very small site with almost no visitors at all. Written in Kohana and was previously hosted in Pagodabox, I’ve migrated it to Google AppEngine for Python 2.7. It was fun and frustrating at the … Continue reading

Posted in Python | Tagged , , , , , , | Leave a comment

AppEngine – Python – Caches Object Values

[UPDATE]: Solved this problem, explanation at the bottom. So I have this semi-MVC AppEngine for Python setup where I setup different CSS/JS files per page. The problem is that AppEngine caches object values causing values to stack. Example, if I … Continue reading

Posted in Python | Tagged , | Leave a comment

Sum First column of a File – Python Script

I keep on summarizing error logs and one of the task is to sum up all occurrences of all errors/warnings/notices etc on the hourly error log sent via email. Instead of adding them one by one, I’ve created a small … Continue reading

Posted in Python | Tagged , , , , , , , | Leave a comment

Unit Testing with Python and Google App Engine

It came to the point where developing my soon to be web service become too difficult since I have to write test codes on my request handlers. I finally made my way to Python Unit testing using the unittest module. … Continue reading

Posted in Python | Tagged , , , , , | Leave a comment