'sqlite3' isn't an available database backend.

前端之家收集整理的这篇文章主要介绍了'sqlite3' isn't an available database backend.前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

运行 python manage.py syncdb 报错:

django.core.exceptions.ImproperlyConfigured: 'sqlite3' isn't an available database backend.

Try using django.db.backends.sqlite3 instead.

Error was: No module named base

我特意看了一眼装没装sqlite3:

sqlite3 -version

一看还真有:
3.7.7 2011-06-25 16:35:41 8f8b373eed7052e6e93c1805fc1effcf1db09366

然后再仔细看报错,怀疑可能是 Django1.4 里面settings简写sqlite3不行,好像得写全django.db.backends.sqlite3。于是改了一下settings.py :

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',# Add 'postgresql_psycopg2','MysqL','sqlite3' or 'oracle'.
'NAME': '/opt/test.db',# Or path to database file if using sqlite3.
'USER': '',# Not used with sqlite3.
'PASSWORD': '',# Not used with sqlite3.
'HOST': '',# Set to empty string for localhost. Not used with sqlite3.
'PORT': '',# Set to empty string for default. Not used with sqlite3.
}
}

错误解决

原文链接:https://www.f2er.com/sqlite/202002.html

猜你在找的Sqlite相关文章