title: django.core.exceptions.ImproperlyConfigured: SpatiaLite requires SQLite to be configured to allow extension loading
body: <p>I installed <code>spatialite</code> for <code>Django</code> project but when I try to migrate it show me this error :</p>
  
  <pre><code>File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/django/contrib/gis/db/backends/spatialite/base.py", line 44, in get_new_connection
      raise ImproperlyConfigured(
  django.core.exceptions.ImproperlyConfigured: SpatiaLite requires SQLite to be configured to allow extension loading.
  </code></pre>
  
  <p>I don't know how to figure out.
  I tried  <a href="https://docs.djangoproject.com/en/1.7/ref/contrib/gis/install/spatialite/" rel="nofollow noreferrer"> this </a> by changing libexec/setuptools/setup.cfg file</p>
  
  <pre><code>[build_ext]
   #define=
  include_dirs=/Library/Frameworks/SQLite3.framework/unix/include
  library_dirs=/Library/Frameworks/SQLite3.framework/unix/lib
  libraries=sqlite3
  #define=SQLITE_OMIT_LOAD_EXTENSION
  </code></pre>
  
  <p>I have installed spatialite by brew then I changed the settings.py like this:</p>
  
  <pre><code>DATABASES = {
   'default': {
      'ENGINE': 'django.contrib.gis.db.backends.spatialite',
      'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
   }
  }
  SPATIALITE_LIBRARY_PATH='/usr/local/lib/mod_spatialite.dylib'
  </code></pre>