Tumblog archive for December
The Uswaretech Blog: Using Paypal with Django
A great article on using PayPal within Django. Currently for WhisperGifts I create an encrypted button, however this means the users' end-point is the PayPal website. Using the snippets linked to from this article, the user sees PayPal as a single step and the final end-point is on your own website, giving you more control over the checkout process.
http://uswaretech.com/blog/2008/11/using-paypal-with-django/Tony Hauber: Django Schedule, a pluggable calendar app for Django
Tony Hauber has put together a fantastic pluggable application for Django which allows you to manage events, including recurring events. This will be very useful for an upcoming project where I've hacked together my own recurring event framework that's absurdly messy. Recurring events are hard to get right, but it appears Tony has got it right here.
http://thauber.com/blog/post/django-schedule/James Bennett: Users and the Admin
James Bennett has written this great article on adding user controls to your Django admin screens: Only allow users to see and edit their own content, unless they're a superuser.
A great example of what's possible with the 'new' admin - just don't ignore his wise advice: "*that’s a problem no amount of technology will solve for you: if you can’t rely on your site administrators to do the right thing, then they shouldn’t be your site administrators. *"
http://www.b-list.org/weblog/2008/dec/24/admin/Jannis Leidel - An autocomplete widget for django-tagging form fields
Jannis Leidel has put together this useful blog post which shows how to use jQuery to provide autosuggest on your django-tagging fields in Django, in both the automatic Admin screens and in your own custom forms.
The only real downside I can see is that it sends the entire tag list with the initial request, so if you have hundreds or thousands of tags then it wouldn't be overly bandwidth-friendly. In those situations it should be relatively easy to modify this to use an XMLHttpRequest, though.
Nice work, Jannis!
http://jannisleidel.com/2008/11/autocomplete-widget-for-django-tagging-form-fields/An offline distraction
One of the many reasons I haven't been online much recently is a new deck out the front of our house, an area which until now was just gravel and mud.
After building it myself over about 3-4 months of weekends I'm glad it's done - and I've got a new-found appreciation for my job and for the job of builders. It's nice to get away from the computer and work on something physical as it gives you instant feedback and a real sense of progress.
My next job is to landscape my (very steep) back yard to turn it into a usable space. I'm guessing by the time I'm done I'll have a great appreciation for landscape gardeners, too :)
http://www.flickr.com/photos/rpoulton/2862125076/in/set-72157607319451969/A Fair Go for Craft Beer - Excise Tax is Killing Craft Beer in Australia!
On top of all the usual taxes any small business pays, Australian craft breweries have to fork out 25% of their sales income straight to the taxation office in the form of excise.
By comparison, small Australian wineries can sell up to $1.7m of wine per year without paying WET. Like wineries, most microbreweries are regional family-owned businesses. By increasing the excise refund for microbreweries to levels closer to that of the wineries, more microbreweries can afford to produce even better beer by employing expert brewers, purchasing better equipment, and accessing better distribution channels.
If you live in Australia, I encourage you to visit one of the petition sites listed and sign this petition before the end of January. As a beer lover and homebrewer, I'd love to see more unique beers on the market here (or, alternatively, have them easier to access - it'd be great to have more micros available in pubs & clubs).
http://www.fairgocraftbeer.com.au/Django Site of the Week: Ooh-Ga-Boo-Ga
The second Django Site of the Week is online. This week it's Satchmo website extraordinaire Ooh-Ga-Boo-Gah.
Dynamic ModelForms in Django
Since 'newforms' became the norm within Django, there seems to have been some confusion relating to dynamic forms that relate specifically to a model.
The basic way to handle forms is to use a ModelForm for simple single-model-related forms, and Form instances for everything else, including more advanced Model-based forms. Many people seem to forget, however, that a ModelForm or Form instance can be manipulated after it's created.
In this blog post, I have included a design pattern I've recently used that should be of use to others who want to tweak their ModelForm instances at runtime.
Django Site of the Week
Since I started DjangoSites over a year ago, the response has been fantastic. I used to approve a handful of websites a week, recently it's more like a half-dozen a day.
I've decided that a bunch of those websites are just awesome, and I wanted to have a chat with the owners of those sites and share their stories with the Django Community. Without further ado, I would like to introduce the Django Site of the Week. The first featured website is Disqus, and an article has been published at the SOTW website based on my interview with Daniel Ha, one of the founders.
Business Cards!
I've had a few meetings recently relating to Django, so I figured I should have some of my own business cards. I went with a nice simple design with sparse information, although these ones are straight off a digital printer so colour quality isn't quite what I wanted. For the next batch (when I have more time up my sleeves) I'll go offset printing for sure.
I also picked up a Moleskine notebook, it's great for taking notes and keeping ideas & wireframes. Much easier than the A4 book I used to lug around.