相关疑难解决方法(0)

ImportError:在Google应用引擎中找不到django.utils

当我在谷歌应用引擎项目中使用来自django.utils的simplejson时出现此错误:

Traceback (most recent call last):
  File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 187, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 225, in _LoadHandler
    handler = __import__(path[0])
  File "/base/data/home/apps/s~testapp/1.359839747994604729/notify.py", line 8, in <module>
    from handlers.xmpp_handler import XMPPHandler
  File "/base/data/home/apps/s~testapp/1.359839747994604729/handlers/xmpp_handler.py", line 12, in <module>
    import commands
  File "/base/data/home/apps/s~testapp/1.359839747994604729/handlers/commands.py", line 4, in <module>
    from django.utils import simplejson
ImportError: No module named django.utils
Run Code Online (Sandbox Code Playgroud)

片段:

import datetime
from google.appengine.api import users
from google.appengine.ext import db
from django.utils import simplejson

class jsonEncoder(simplejson.JSONEncoder):
    def default(self, obj):
        if isinstance(obj, datetime.datetime): …
Run Code Online (Sandbox Code Playgroud)

django google-app-engine json

4
推荐指数
1
解决办法
7064
查看次数

标签 统计

django ×1

google-app-engine ×1

json ×1