sometimes you need to create a stand alone django script to use the django orm. I have done this to import data from csv into my django database with the handy orm:
see how to do it here:
http://code.djangoproject.com/ticket/5534#comment:6