Index: django/db/backends/ado_mssql/base.py
===================================================================
--- django/db/backends/ado_mssql/base.py	(revision 5487)
+++ django/db/backends/ado_mssql/base.py	(working copy)
@@ -84,6 +84,12 @@
         if self.connection is not None:
             return self.connection.rollback()
 
+    def _disable_broken_foreign_key_checks(self):
+        pass
+    
+    def _enable_broken_foreign_key_checks(self):
+        pass
+
     def close(self):
         if self.connection is not None:
             self.connection.close()
Index: django/db/backends/mysql_old/base.py
===================================================================
--- django/db/backends/mysql_old/base.py	(revision 5487)
+++ django/db/backends/mysql_old/base.py	(working copy)
@@ -120,6 +120,12 @@
             except Database.NotSupportedError:
                 pass
 
+    def _disable_broken_foreign_key_checks(self):
+        pass
+    
+    def _enable_broken_foreign_key_checks(self):
+        pass
+
     def close(self):
         if self.connection is not None:
             self.connection.close()
Index: django/db/backends/postgresql/base.py
===================================================================
--- django/db/backends/postgresql/base.py	(revision 5487)
+++ django/db/backends/postgresql/base.py	(working copy)
@@ -100,6 +100,12 @@
         if self.connection is not None:
             return self.connection.rollback()
 
+    def _disable_broken_foreign_key_checks(self):
+        pass
+    
+    def _enable_broken_foreign_key_checks(self):
+        pass
+
     def close(self):
         if self.connection is not None:
             self.connection.close()
Index: django/db/backends/sqlite3/base.py
===================================================================
--- django/db/backends/sqlite3/base.py	(revision 5487)
+++ django/db/backends/sqlite3/base.py	(working copy)
@@ -82,6 +82,12 @@
         if self.connection is not None:
             self.connection.rollback()
 
+    def _disable_broken_foreign_key_checks(self):
+        pass
+    
+    def _enable_broken_foreign_key_checks(self):
+        pass
+
     def close(self):
         from django.conf import settings
         # If database is in memory, closing the connection destroys the database.
Index: django/db/backends/mysql/base.py
===================================================================
--- django/db/backends/mysql/base.py	(revision 5487)
+++ django/db/backends/mysql/base.py	(working copy)
@@ -118,6 +118,14 @@
                 self.connection.rollback()
             except Database.NotSupportedError:
                 pass
+    
+    def _disable_broken_foreign_key_checks(self):
+        if self.connection is not None:
+            self.connection.cursor().execute('SET FOREIGN_KEY_CHECKS = 0;')
+    
+    def _enable_broken_foreign_key_checks(self):
+        if self.connection is not None:
+            self.connection.cursor().execute('SET FOREIGN_KEY_CHECKS = 1;')
 
     def close(self):
         if self.connection is not None:
Index: django/db/backends/oracle/base.py
===================================================================
--- django/db/backends/oracle/base.py	(revision 5487)
+++ django/db/backends/oracle/base.py	(working copy)
@@ -54,6 +54,12 @@
             except Database.NotSupportedError:
                 pass
 
+    def _disable_broken_foreign_key_checks(self):
+        pass
+    
+    def _enable_broken_foreign_key_checks(self):
+        pass
+
     def close(self):
         if self.connection is not None:
             self.connection.close()
Index: django/db/backends/postgresql_psycopg2/base.py
===================================================================
--- django/db/backends/postgresql_psycopg2/base.py	(revision 5487)
+++ django/db/backends/postgresql_psycopg2/base.py	(working copy)
@@ -68,6 +68,12 @@
         if self.connection is not None:
             return self.connection.rollback()
 
+    def _disable_broken_foreign_key_checks(self):
+        pass
+    
+    def _enable_broken_foreign_key_checks(self):
+        pass
+
     def close(self):
         if self.connection is not None:
             self.connection.close()
Index: django/db/backends/dummy/base.py
===================================================================
--- django/db/backends/dummy/base.py	(revision 5487)
+++ django/db/backends/dummy/base.py	(working copy)
@@ -25,6 +25,8 @@
     cursor = complain
     _commit = complain
     _rollback = ignore
+    _disable_broken_foreign_key_checks = ignore
+    _enable_broken_foreign_key_checks = ignore
 
     def __init__(self, **kwargs):
         pass
Index: django/db/transaction.py
===================================================================
--- django/db/transaction.py	(revision 5487)
+++ django/db/transaction.py	(working copy)
@@ -53,6 +53,7 @@
         state[thread_ident].append(settings.TRANSACTIONS_MANAGED)
     if thread_ident not in dirty:
         dirty[thread_ident] = False
+    connection._disable_broken_foreign_key_checks()
 
 def leave_transaction_management():
     """
@@ -68,6 +69,7 @@
     if dirty.get(thread_ident, False):
         rollback()
         raise TransactionManagementError("Transaction managed block ended with pending COMMIT/ROLLBACK")
+    connection._enable_broken_foreign_key_checks()
     dirty[thread_ident] = False
 
 def is_dirty():
