  """
   The GeometryColumns and SpatialRefSys models for the SpatiaLite backend.
  """
  from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin
  from django.contrib.gis.db.backends.spatialite.base import DatabaseWrapper
  from django.db import connection, models
  from django.db.backends.signals import connection_created
  from django.utils.encoding import python_2_unicode_compatible
  
  
  @python_2_unicode_compatible
  class SpatialiteGeometryColumns(models.Model):
 
</s> remove from django.db import connection
 </s> add  </s> remove http://www.gaia-gis.it/spatialite-3.0.0-BETA/spatialite-sql-3.0.0.html
 </s> add  </s> remove         if version < (3, 0, 0):
            raise ImproperlyConfigured('GeoDjango only supports SpatiaLite versions 3.0.0 and above.')
 </s> add         if version < (4, 0, 0):
            raise ImproperlyConfigured('GeoDjango only supports SpatiaLite versions 4.0.0 and above.') </s> remove 

def add_spatial_version_related_fields(sender, **kwargs):
    """
    Adds fields after establishing a database connection to prevent database
    operations at compile time.
    """
    if connection_created.disconnect(add_spatial_version_related_fields, sender=DatabaseWrapper):
        spatial_version = connection.ops.spatial_version[0]
        if spatial_version >= 4:
            SpatialiteSpatialRefSys.add_to_class('srtext', models.CharField(max_length=2048))
            SpatialiteGeometryColumns.add_to_class('type', models.IntegerField(db_column='geometry_type'))
        else:
            SpatialiteGeometryColumns.add_to_class('type', models.CharField(max_length=30))
connection_created.connect(add_spatial_version_related_fields, sender=DatabaseWrapper)
 </s> add 
from django.db import models
  """
   The GeometryColumns and SpatialRefSys models for the SpatiaLite backend.
  """
  from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin
from django.db import models
from django.db import models
from django.db import models
  from django.utils.encoding import python_2_unicode_compatible
  
  
  @python_2_unicode_compatible
  class SpatialiteGeometryColumns(models.Model):
keep keep keep keep replace replace replace keep keep keep keep keep
 Fixed #25645 -- Dropped support for SpatiaLite < 4.0. 
django/contrib/gis/db/backends/spatialite/models.py