在Google App Engine中使用sqlite3?
我正在尝试把我的Python + Django项目部署到Google App Engine上。目前在我的电脑上运行得很好,但当我尝试在Google App Engine上运行这个项目时,出现了以下错误。
ImproperlyConfigured: 'django.db.backends.sqlite3' isn't an available database backend.
Try using django.db.backends.XXX, where XXX is one of:
'dummy', 'mysql', 'oracle', 'postgresql', 'postgresql_psycopg2', 'sqlite3'
Error was: cannot import name utils
这是我settings.py文件中指定sqlite3数据库的部分:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'mydb.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.
}
}
1 个回答
12
Google App Engine要求你使用它自己的数据存储,而不是像sqlite或其他数据库。有一个项目叫做django-nonrel,可以让你在App Engine上使用几乎和普通Django模型一样的东西。你可以在这里找到更多关于如何设置的信息:http://code.google.com/appengine/articles/django-nonrel.html