Dec 9 2012

Python Error Logging to Amazon Web Services’ Simple Notification Service (SNS)

Jamie Begin

As part of the standard library, Python provides a very flexible logging module that includes the ability to define custom handlers. Commonly this is used to log errors to Syslog, SMTP, a database, etc. However, we can also easily adapt it to log to a Amazon Web Services Simple Notification Service (SNS) topic. Subscribers (either […] …

Read more

Aug 17 2010

ImportError: No module named pysqlite2

Jamie Begin

Currently my favorite web app environment includes: CentOS 5.5 Python 2.6 (built from source) Pylons 1.0 (w/ SQLAlchemy 0.5.8) nginx Whenever I setup a new environment, and execute “paster serve –reload development.ini” for the first time, I always get a stack trace from SQLAlchemy that ends with the following error message: Impor …

Read more

Feb 10 2010

Deploying a Pylons App to Production, Step-by-Step (Part 2 of 2)

Jamie Begin

In Part 1 of this tutorial, I described how to prepare Nginx (along with Apache) to serve a production Pylons app. In this article, I walk you through packaging and installing your application. Packaging Your Pylons App The official Pylons book offers a lengthy section on how to package your application. However, I feel that […] …

Read more

Feb 9 2010

Deploying a Pylons App to Production, Step-by-Step (Part 1 of 2)

Jamie Begin

I think there’s a very good reason why the “Deployment” chapter in the official Pylons book is listed in section entitled “Expert Pylons.” Deploying a Pylons app into a production environment can be a real hair-puller for the folks coming from the PHP or ASP/ASP.Net worlds. Like most everything else about Pylons, you h …

Read more

Dec 27 2006

Recursively checking for missing alt attributes on img tags with 38 lines of Python code.

Jamie Begin

Today I was the first time I’ve used my new found Python skills in a professional capacity. As part of a larger project, the client wanted me to check each HTML document for image tags missing their “alt” attributes. Knowing how tedious and impercise it would be to do this manually, writing a script was […] …

Read more

Dec 23 2006

A PHP Developer Spends a Week with Python

Jamie Begin

Last week, I wrote about my discontent with PHP and why I chose to give Python a shot at becoming my new tool of choice. Since then, Python and I have spent a lot of time together getting acquainted. I’m finally becoming accustomed to the lack of semicolons and curly braces and have accepted Python’s […] …

Read more

Dec 20 2006

From PHP to Python

Jamie Begin

Before I wrote my “Dear John” letter to PHP the other day, I had largely decided to move to Python as my primary tool. I had been on the fence for months about choosing to pursue Ruby or to follow the Python path. I purchased a book about each and did quite a bit of […] …

Read more