[Django]-Is sqlite bundled into Django?

5πŸ‘

βœ…

You’re looking for this:

21  try:
22      try:
23          from pysqlite2 import dbapi2 as Database
24      except ImportError, e1:
25          from sqlite3 import dbapi2 as Database
26  except ImportError, exc:
27      from django.core.exceptions import ImproperlyConfigured
28      raise ImproperlyConfigured("Error loading either pysqlite2 or sqlite3 modules (tried in that order): %s" % exc)

It first attempts to import PySqlite, an external module. If that fails, it tries to import the sqlite3 module included in Python 2.5+. If neither Python 2.5+ nor the external module are installed, it fails. It does not include its own copy.

πŸ‘€Bob

4πŸ‘

Sqlite is part of the Python standard library, so it is always available to Django.

3πŸ‘

I think SQLite comes standard with Python 2.5+ – so it doesn’t need to be bundled with Django.

πŸ‘€nrabinowitz

Leave a comment