Django Interactive Console Debug
1.执行python manager.py shell进入交互模式2.连接数据库from django.db import connection, transactioncur = connection.cursor()3.执行sql语句操作数据库cur.execute("drop table south_migrationhistory") # de
·
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更多推荐


所有评论(0)