Piping django commands into mysql
Some of the management commands in Django (sqlflush and sqlclear spring to mind) rather understandably don't act straight on the database as they delete large amounts of data. They instead print out the sql commands for you to use at your leisure.
Being a lazy sort I rarely feel like copying and pasting things about so here's how to pipe sqlclear straight into mysql:
python manage.py sqlclear [list of app names] | mysql -u [username] -p[password] -D [database name]
sqlflush doesn't take any arguments so:
python manage.py sqlflush [list of app names] | mysql -u [username] -p[password] -D [database name]
So, now we've sorted out how to get round what the Django guys were trying to stop please don't delete any of your data, and if you do tell your wife, kids or dog about it rather than me.