【问题标题】:app engine python is this bug: when open switch interactive consoleapp engine python是这个bug:when open switch interactive console
【发布时间】:2012-01-27 15:02:00
【问题描述】:

当我在localhost:8080 工作时,当我打开交互式控制台并执行一些操作时,例如获取Kind 等的列表(地址:http://localhost:8080/_ah/admin/interactive)然后它给了我这个错误:

<class 'google.appengine.dist._library.UnacceptableVersionError'>: django 1.2 was requested, but 0.96.4.None is already in use

这个错误发生了好几次,在类似的情况下。在dev_appserver.py重新启动本地主机之前一直卡住

这是一个错误还是我做错了什么?

我在交互式控制台中所做的示例:

from myapp.models import *
for room in Room.all():
    room.update_time = room.create_time
    room.put()

注意:
这是我的django_bootstrap

import os
import sys
import logging
import __builtin__
from google.appengine.ext.webapp import util

import pickle
sys.modules['cPicle'] =pickle

logging.getLogger().setLevel(logging.INFO)

sys.path.insert(0, os.path.abspath((os.path.dirname(__file__))))

import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

from google.appengine.dist import use_library
use_library('django', '1.2')


import django.core.handlers.wsgi

def main():
    application = django.core.handlers.wsgi.WSGIHandler()
    util.run_wsgi_app(application)    

if __name__ == '__main__':    
    main()

【问题讨论】:

    标签: python google-app-engine


    【解决方案1】:

    我在根文件夹中的index.ymal 说:

    # AUTOGENERATED
    
    # This index.yaml is automatically updated whenever the dev_appserver
    # detects that a new type of query is run.  If you want to manage the
    # index.yaml file manually, remove the above marker line (the line
    # saying "# AUTOGENERATED").  If you want to manage some indexes
    # manually, move them above the marker line.  The index.yaml file is
    # automatically uploaded to the admin console when you next deploy
    # your application using appcfg.py.
    

    因此每次我打开http://localhost:8080/_ah/admin/datastore时,这个文件都会更新:它仍然具有相同的内容,但操作系统上的文件时间戳表示它已更新。

    我认为在这里,http://localhost:8080 看到 models.py 不一样然后它可以加载它然后无法启动 django_bootstrap。

    但是,如果我先打开 http://localhost:8080/_ah/admin/datastore,然后打开 http://localhost:8080,它就可以工作。所以这就是为什么有时我有时不会出错:这取决于各自的订单网址

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-07
      • 2014-08-05
      • 1970-01-01
      • 1970-01-01
      • 2019-05-17
      相关资源
      最近更新 更多