在Google App Engine中使用sqlite3? [英] Using sqlite3 within Google App Engine?
问题描述
我正在尝试将我的Python + Django项目部署到Google App Engine。现在它在本地计算机上工作正常,但是当我尝试将其作为Google App Engine中的项目运行时,我收到以下错误。
I am trying to deploy my Python + Django project to the Google App Engine. Right now it works fine on my local computer, but when I try running it as a project within the Google App Engine, I get the following error.
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数据库:
Here is the part of my settings.py file that specifies the sqlite3 database:
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.
}
}
推荐答案
Google App Engine要求您使用自己的数据存储区,而不是sqlite或其他数据库。有一个项目将允许您在名为django-nonrel的App Engine上使用几乎常规的Django模型。您可以在这里找到有关设置它的更多信息: http://code.google。 com / appengine / articles / django-nonrel.html
Google App Engine requires that you use its own datastore, rather than sqlite or another database. There is a project that will allow you to use pretty much regular Django models on App Engine called django-nonrel. You can find more information about setting it up here: http://code.google.com/appengine/articles/django-nonrel.html
这篇关于在Google App Engine中使用sqlite3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!