Django Interactive Console Debug

1.执行

python manager.py shell

进入交互模式

2.连接数据库

from django.db import connection, transaction
cur = connection.cursor()
3.执行sql语句操作数据库

cur.execute("drop table south_migrationhistory")  # delete table south_migrationhistory
transaction.commit_unless_managed()   # commit changes to database



你可能感兴趣的:(django,south)