Custom Django management commands on Heroku

Quick solution to a common Django/Heroku problem.

Running Django management commands is easy on Heroku. For example, to syncdb you simply execute:

$ heroku run python your_app/manage.py syncdb

Easy enough. But you may find that running a custom management command to be a little trickier. You ...

Read more

Why Django?

In 5 words or less… Why do you use Django?

I have been a heavy Django developer, architect, and evangelist since about 2006 when Nowell Strite and I first saw a presentation by Adrian and Jacob at OSCON. We brought Django back to PBS where it quickly became our standard development platform.

Read more

Faetus: An FTP interface to Amazon S3 file storage.

An FTP interface to Amazon S3 file storage.

What?

Faetus is an FTP server that translates FTP commands into Amazon S3 API calls providing an FTP interface on top of Amazon S3 storage.

image1

Why?

Amazon's S3 API is awesome and there are plenty of excellent libraries that make this very simple. However, sometimes you don't have control over a system, ...

Read more

pyawschart

Python library for generating charts for Amazon Web Services based on Amazon CloudWatch data.

What?

pyawschart is a Python library for generating charts for Amazon Web Services based on Amazon CloudWatch data.

pyawschart-rds-writeops-example-1

Why?

Amazon's cloud services provide infrastructure metrics data ...

Read more

django-simplegravatar v0.2

Gravatar support for Django projects

What?

A simpler Django template tag to add Gravatar support to your Django projects. This is based on my 2008 post entitled Implementing Gravatar in Django.

Installation

To install this app, simply:

  1. pip install ...

Read more

Concatenating strings in Django templates

Cheap ass hack to append a string within Django templates.

You might think that joining two strings in a Django template would have been simple and straightforward. In modern versions of Django, we can achieve it using the add filter.

{{ "Mary had a little"|add:" lamb." }}

However, in ...

Read more

DCPython: Architecture at PBS

Slides from DCPython meetup on Jun 7, 2011

Edgar and I had the pleasure of presenting at the DCPython meetup last night about how PBS uses Python, Django, Celery, Solr and Amazon Web Services (autoscaling EC2, RDS) to power many of our sites and services. We focused primarily on the COVE (video) and Merlin (content) APIs since those probably have the most interesting ...

Read more

Recovering from Amazon cloud outage

What happens when the AWS cloud has a very, very bad day?

Amazon Web Services (AWS) have been integral to the successes of nearly all recent project launches at PBS. All of our core applications are deployed out on AWS EC2 servers and RDS database instances. While we have experienced an occasional component failure, these have been infrequent. When failures have occurred, we have typically been able to leverage the agility ...

Read more

mod_wsgi and the HTTP Authorization header

A friendly reminder for myself to RTFD!

If one is building a WSGI application on mod_wsgi and one wants this WSGI application to handle HTTP authentication, it is likely that one will need access to the "Authorization" HTTP header at some point. Had one read the documentation, one would have already understood that mod_wsgi does not pass this header to your WSGI application by default. This is probably a very good thing.

To tell mod_wsgi to pass the Authorization header through to your application, just set the ...

Read more

AWS Identity and Access Management (IAM) with Python

Flexible access control to AWS cloud services using Amazon IAM, Python, and boto

With all the AWS services that are now available, our opportunities in the cloud are virtually unlimited. But using any of these services requires access to your AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY and unfortunately, these keys provides complete access to the kingdom. This may not be a problem for some, but for large enterprises, granular access control is a necessity.

Up until recently, we would have been out ...

Read more

pyawschart - v0.2 released

Amazon CloudWatch data visualization

I have just pushed the source code for pyawschart - v0.2 out to GitHub. This project was created a few months back and I have been using it for personal (Proboscis) and professional (PBS) projects since then. I've just decided to open ...

Read more

Lunar eclipse photos

From an extremely amateur photographer

I'm no photographer, but since I was staying up late to watch this morning's total lunar eclipse anyway (what is it, almost 6am now?), I decided to break out my camera, point the lens skyward, and see what happens. Of course, I had absolutely no idea what I was doing and I messed with all sorts of settings (ISO, f-stop, shutter speed, white balance), but I eventually came up with some ...

Read more