I’ve become a really big fan of the PickledObjectField provided by this django snippet. So much so that I use it in almost every django model I create these days. Basically it serves as the best way to do an object store in your database and perfectly translates in any JSON conversion. Its an essential [...]
Archive for the ‘django’ Category
30 Sep
Initialize Django Tests
I use a lot of doctests for apps that all need to work on a set of initialized data. I was hoping that there would be some kind of hook in Django for this but there is not. I could switch all of the doctests to unittests and use fixtures but that would be a [...]
21 Jul
Appengine Example: Quick Thoughts
I’ve made a few apps on Google’s Appengine now and am getting to the point where I can pump them out fairly quickly. I really love that they make user authentication (my least favorite part of web applications) incredibly simplified. I wrote this app in less than an hour as a simple tool for myself [...]
11 May
Using Arguments in a Shell Script
Within 5 seconds of looking at a shell script I’m usually opening a new file in my text editor to re-write the ugliness into something that makes more visual sense. To me at least python is highly preferable. Still I use shell scripts all the time to batch a group of commonly used sequential executions, [...]
10 May
‘drop’ Database Command for Django Manager
The Django manager is a really handy tool. I wrote earlier about making your own custom managers and there is a lot of other great documentation on it. Django comes with a bunch of helpful management commands like ‘flush’, ‘syncdb’, ‘test’, etc. I’ve created a generic ‘drop’ command as I felt it was missing. I [...]
6 May
Some Notes and Requests on Django Signals
I’ve finally gotten around to playing with the Django Signals. I’ve been pleased so far but I feel its currently missing a few key features. Some background: Django Signals allows developers to more easily break up their code into separate components which allows much greater freedom and organization. Often as a web application expands you [...]
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. [...]