According to this test, setting PRAGMA synchronous=OFF Sqlite can dramatically improve Sqlite write performance.
I am well aware of the drawbacks, but would still like t
Add this code in the __init__.py
file of one of your installed app:
from django.db.backends.signals import connection_created
def activate_foreign_keys(sender, connection, **kwargs):
"""Enable integrity constraint with sqlite."""
if connection.vendor == 'sqlite':
cursor = connection.cursor()
cursor.execute('PRAGMA foreign_keys = ON;')
connection_created.connect(activate_foreign_keys)