Today I was switching from the Python Cheese Shop’s version of the Twisted Web Framework to the trunk version. I’d previously installed Twisted with the handy easy_install PackageName Worked great! Unfortunately its not so obvious on how to uninstall… After some research I found it and am sharing it here so I wont’ forget. Simply [...]
Archive for the ‘python’ Category
13 Mar
Adding Custom Commands to manage.py and django-admin.py
In Django it is very straight forward to add extra commands to the manage.py and django-admin.py scripts. The Django Documentation describes the process but gives no examples. I like examples so I’m writing this for others. In the past I’d add these to make stand alone scripts that used the Django libraries. from django.conf import [...]
26 Jan
Satchmo on Ubuntu
I’ve sadly spent the better part of the day getting Satchmo deployed on my slicehost. It should’ve been easy, as I’ve already installed it on my mac. Due to Satchmo backwards incompatibilities and some odd things with slicehost locale’s its now a late night and I have a banged head and more than a few [...]
6 Jan
Django Email Admins Using Different Outgoing Email Address
Socialbrowse is deployed on EC2 using the Django framework. Unfortunately, as we learned the hard way, EC2 has some serious issues with both reverseDNS and email blocklists and is a horrible place to send emails from. For this reason we use AuthSMTP, an email application that will has a much larger success rate for outgoing [...]
5 Jan
Using Subdomains in Django
Django’s url dispatcher doesn’t handle subdomains. If you want/need to use subdomains you’ve got to use session middleware. If you haven’t written any middleware yet don’t freak out, is easy. There’s some easy documentation for extra information but for our needs all you need to do is make a Class with a function called process_request. [...]
5 Jan
Relative URL Parser Snippet
Python 3.0 seems to come with fancy new features to urllib including urllib.parse which is an excellent utility for parsing the different components of URLs. I however don’t use python 3.0 yet and needed a clean way to make full URLs given a base URL and relative URLs. This is helpful if you’re scraping a [...]
2 Jan
Installing CSSTidy and Scons on OS X or Linux
I’m setting up django-compress, and incredibly helpful django tool for compressing media files. By default it requires the installation of CSSTidy which was not as smooth of a task as most. Here are my notes. Installing Scons To install CSSTidy you have to have Scons in order to install it. Scons is similar to Make [...]
28 Dec
Django-admin.py startproject > Unknown Command
This is hardly worth a post but I’d found nothing on google for the fix and so I’m documenting it here for others. In Django v 1.0 django-admin.py has smartly been altered to behave the same as ./manage.py. It seems that this has effected the startproject command in the event that your DJANGO_SETTINGS_MODULE environment variable [...]
16 Dec
Get Around Corporate Firewalls: Make Your Own Proxy
I’ve been doing some research into all kinds of proxies lately. One of the simple examples I tried out has a great working use case. It is especially useful if you are in the following situation. 1. Your work blocks/firewalls certain websites and this bugs you. 2. You have a server somewhere that you can [...]
5 Jul
Plone Sprint at Google
I had the privilege of spending last week at the google campus hacking at the doccom Plone sprint. It was an awesome experience both to work inside the area that justly has the reputation as one of the most awesome places to work, and to take part in Plone’s excellent open source community. Here’s a [...]