GAE Error django.core.exception



下载完GAE 1.8.0包后。在我的Mac OS 10.7中,我尝试了一个来自谷歌的例子,当我导入这个:

from google.appengine.ext.db import djangoforms

我得到这个错误:

Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/python/request_handler.py", line 156, in handle_interactive_request
exec(compiled_code, self._command_globals)
File "<string>", line 8, in <module>
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/db/djangoforms.py", line 97, in <module>
import django.core.exceptions
ImportError: No module named django.core.exceptions

我正在交互控制台和应用程序中尝试这个

我需要安装其他软件包吗?

你应该看看文档。

https://developers.google.com/appengine/docs/python/tools/libraries27

django被包含在运行时中,但是你需要通过app.yaml libraries指令来配置它的包含。

另外,如果你没有使用django,可以考虑jinja作为django表单的模板语言。

将此添加到您的app.yaml中:

libraries:
- name: django
  version: latest

阅读这篇如何使用第三方库的链接。

最新更新