Posts for django
OSError while installing Django with buildout and djangorecipe
A corrupted Django tarball can cause mysterious errors from djangorecipe.
Migrating to Django Mingus
I've migrated my blog from a creaking Plone 2.5 to a fork of Django Mingus. This is the process I went through.
Python, Unicode and UnicodeDecodeError
In the years I've been developing in Python, Unicode seems to be the topic which causes the greatest amount of confusion amongst developers. Hopefully much of this confusion should go away in Python 3, for reasons I'll come to at the end; but until then, the UnicodeDecodeError is the bane of many developers' lives.
Installing GeoDjango with PostgreSQL and zc.buildout
The installation of the PostgreSQL requirements is somewhat daunting. I've spent a bit of time putting together a buildout.cfg to try to make this easier.
fez.djangoskel: Django projects and apps as eggs
I've made an initial release of fez.djangoskel, which provides simple paster templates for egg-based Django projects and applications.
A Django Development Environment with zc.buildout
This article will show you how to create a repeatable Django development environment from scratch using zc.buildout.
Django Unit Tests and Transactions
While these are more properly integration tests than unit tests, it can be handy to have Django roll back the database transaction after each test method runs.
Django Redirects (Updated)
This is a quick-n-dirty app to let you set up redirects on your Django site through the admin interface. (Updated to reflect my own oversight of django.contrib.redirects, which, er, does all this for you...)
djangopeople.net, GeoDjango and PostGIS
Michael Trier's "This Week In Django" podcast is turning into something of a gem mine. I'm particularly taken with one website he mentioned, djangopeople.net. Plus, thoughts on GeoDjango and PostGIS, and the iPhone's Wi-Fi Locations technology.
Django ModelForm and newforms
Browsing the Django code after a recent svn up shows that newforms.form_for_instance and friends are deprecated and that you should use a ModelForm instead. This post gives a brief example of how to do this.
'unicode' object has no attribute 'get_sql'
I keep getting this error, and it always takes a moment of head-scratching to figure out what's wrong. Here's what's wrong, to save you some hair.
Adapters in Django and the Revenge of Zope
Using Zope 3's component architecture can significantly reduce dependencies between applications within a Django project. Why stand on the shoulders of one giant, when you can stand on the shoulders of two?
GET and POST handling in Django views
Django view functions often feature an initial stanza near the start in order to handle POST data differently. You often end up with quite a lot of logic in one method. Here I describe a cleaner way, using a decorated view class to replace the single function.
Fez Consulting web site live
The Fez Consulting web site has gone live - another dirt simple site built on Django.
Cookieless Django: Sessions and authentication without cookies
Django, by design, maintains its session state by storing a cookie on the client. This is a good design decision. Sometimes, however, you need to track sessions for clients that don't support cookies.
A Django image thumbnail filter
Django filters are a pretty cool idea. I needed to be able to generate image thumbnails. I found some existing code, and fixed it up to, well, work, and also behave better with custom upload_to locations.
Django newforms file upload
Existing documentation about updating request.POST with request.FILES is now obsolete.
Facebook: Photography Qwacks
I'm building a small site for a photography group I'm a member of.