Posts for django

Jul 30

Swoop Travel Live!

Foundry's first GeoDjango site, Swoop Travel, has gone live.

Jan 18

OSError while installing Django with buildout and djangorecipe

A corrupted Django tarball can cause mysterious errors from djangorecipe.

Jan 14

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.

Nov 08

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.

Apr 17

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.

Dec 02

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.

Nov 12

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.

Jul 29

Testing App Views

How to easily test views in applications which don't have a urls.py file.

Jul 01

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.

Mar 07

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...)

Feb 11

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.

Jan 01

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.

Dec 28

'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.

Dec 28

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?

Dec 16

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.

Dec 09

Fez Consulting web site live

The Fez Consulting web site has gone live - another dirt simple site built on Django.

Nov 07

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.

Oct 30

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.

Oct 28

Django newforms file upload

Existing documentation about updating request.POST with request.FILES is now obsolete.

Sep 16

Django with mod_wsgi - live!

My first Django app has gone live, using the new mod_wsgi.

Aug 19

Facebook: Photography Qwacks

I'm building a small site for a photography group I'm a member of.