I usually write my scripts in a temporary file and run them through Django with something like:
$ python manage.py shell <~/tmp-script.py
In this instance, I didn't even consider that what I was doing could be catastrophic. But you're right, you want to avoid doing things manually. In the future, I'll track all the scripts I run. And thanks for the tip about Fabric, I'll check it out.