How to TRUNCATE TABLE using Django's ORM?
You can use the model's _meta property to fill in the database table name:
from django.db import connectioncursor = connection.cursor()cursor.execute('TRUNCATE TABLE "{0}"'.format(MyModel._meta.db_table))
Important: This does not work for inherited models as they span multiple tables!