Es Tea Double Eye

You're never too old for a happy childhood

Category: Python

Django tests fail on a new project

This might be slightly confusing at first, but actually makes perfect sense if you think about it. If you have a brand new Django project and you run the tests it fails with a number of errors. # python manage.py test Creating test database… Creating table auth_permission Creating table auth_group Creating table auth_user Creating table [...]

Call me anal, but I really like Django templates

For all the wrong reasons, but still! I just love the fact that it actually uses a .html extension. Am I weird? I do feel a bit weird that I like something so arb. So the template files use the extension of what it actually contains? Wow, I love that. Revolutionary. Don’t ask me why [...]

HTTP conditional GET with Python urllib2

When aggregating or reading crap loads of RSS feeds, it makes little or no sense to read every feed every time you check, when most feeds is updated only once a day. To give you and idea, at Afrigator the size of the feeds are half a gig (500 MB), so if you do that [...]

Django with apache and mod_wsgi issues

I ran into a fairly common error while setting up Django with mod_wsgi and Apache on Debian. What irritates me about it is that I didn’t pick it up right away, but I’ll blame the long Easter weekend for that. :P ImportError: Could not import settings ‘mysite.settings’ (Is it on sys.path? Does it have syntax [...]

Switched to Python Fabric

We’ve been using Capistrano to deploy Afrigator to our various servers for a while now. I can seriously not complain or say anything bad about Capistrano. Thing is, I’m more familiar with Python than I am with Ruby, thus for me it just makes more sense for me to use Fabric. Here is a small [...]

How to calculate the days between two dates using Python. Quickly.

This is one of those pretty useless things, but you never know when you might just have the need for something like this… I have not taken the time to investigate a quicker way using Bash, but my love of Python made me use it without even thinking twice! :) I first fired up the [...]

Upgrade WordPress using Python Fabric

I’m simply loving Python Fabric. When I heard WordPress 2.7 was out, I thought “I wonder if I could automate this upgrading process?” since it takes a little time to do it manually. Specially if you have to upgarde more than one blog, this would be handy. Here is my fab recipe. Before you get [...]

Bus burns in Cape Town

I just had the fright of my life! With all the bomb scares doing the rounds in Cape Town, I’m pretty edgy. Moments ago, we just heard a BIG bang and initially, everyone thought it was a bomb that went off. Turns out it was actually something in the engine of a City Liner bus [...]

Fabric, Capistrano in Python

If you still use FTP or SCP or sFTP to deploy projects, you’re missing out big time on the ease of either Ruby’s Capistrano or Python’s Fabric. Capistrano is almost synonymous with Ruby on Rails, though it is simple to setup with any project. We at Afrigator uses Capistrano to deploy changes to the staging [...]