Deploying Google Analytics With Django
I mostly agree with Ned, although I have a single setting called IS_LIVE_SITE which toggles analytics code, adverts and a few other things. This way I can keep all the keys in subversion (as it is a pain to look them up) and still toggle them on or off easily.
We're about to deploy a new Django website, and we want to use Google Analytics to keep track of traffic on the site.  However, we don't want all of the hits on development instances to contribute to the Google Analytics statistics.
There are a few ways we could deal with this:

have a configuration option in settings.py which the base template uses to decide whether or not to include the appropriate <script> elements,
maintain a branch which we pull into before deploying to the production server, which we ensure includes the <script> elements,
do something with Google Analytics to block hits to 127.0.0.1 or localhost, or
something else.

The first option seems the most sensible, but I'm not sure if it is.  For example, would we have to start passing a google_analytics variable into all of our views?
What are your thoughts?