【发布时间】:2014-02-13 16:08:49
【问题描述】:
我正在使用 Google App Engine 在 Django 中进行开发。对于生产,我计划使用 Google Cloud SQL,但对于本地开发,我想使用简单的 SQLITE。 Google 教程 (https://developers.google.com/appengine/docs/python/cloud-sql/django) 建议我使用
dev_appserver.py mysite
而不是 Django 默认
manage.py runserver
但是,当我按照 Google 的建议运行开发服务器时,我遇到了两个奇怪的错误(为了清楚起见,我删除了堆栈跟踪的其余部分):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django1.5/django/db/backends/sqlite3/base.py", line 34, in <module>
raise ImproperlyConfigured("Error loading either pysqlite2 or sqlite3 modules (tried in that order): %s" % exc)ImproperlyConfigured: Error loading either pysqlite2 or sqlite3 modules (tried in that order): No module named _sqlite3
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/core/handlers/base.py", line 53, in load_middleware
raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e)) ImproperlyConfigured: Error importing middleware django.contrib.auth.middleware: "cannot import name utils"
最奇怪的是,当我只使用 manage.py runserver 时,站点运行良好。此外,当我直接在交互式 python 提示符中测试 sqlite3 时,它也可以工作:
Python 2.7.5 (default, Aug 25 2013, 00:04:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>>
这里有人可以帮助我吗?我不确定下一步该怎么做。提前致谢!
【问题讨论】:
标签: django sqlite google-app-engine