For one off scripts for a particular project:

#!/usr/bin/env python

from django.core.management import setup_environ
from myapp import settings
setup_environ(settings)

# do some stuff

Related posts:

  1. Setup Python 2.5, mod_wsgi, and Django 1.0 on CentOS 5 (cPanel)
  2. Getting Started with Django and Python – First Impressions
  3. Adventures in Django and Python – Part III
  4. Deployment Using Capistrano / Webistrano via Rails / Phusion Passenger
  5. Setup Python 2.6.4, mod_wsgi 2.6, and Django 1.1.1 on CentOS 5.3 (cPanel)