Django是捆绑sqlite还是单独的模块?
无法弄清楚这一点,即使是通过查看Django来源:
https://code.djangoproject.com/browser/django/trunk/django/db/backends/sqlite3
解决方法
你在找这个:
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)
它首先尝试导入PySqlite,一个外部模块.如果失败,它会尝试导入Python 2.5中包含的sqlite3模块.如果既没有安装Python 2.5也没有安装外部模块,则失败.它不包括自己的副本.