本文介绍了App Engine Python:AttributeError:'模块'对象没有属性'Stock'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在生产中遇到这个错误。pre $
Traceback(最近一次调用最后一次):
文件/ base / python_runtime / python_lib /versions/1/google/appengine/ext/webapp/_webapp25.py,第701行,在__call__
handler.get(* groups)
文件/ base / data / home / apps / s 〜ordenaacoes / 2.357768699674437719 / controllers / mainh.py,第74行,获取
股票:goodStocks(),
文件/base/data/home/apps/s~ordenaacoes/2.357768699674437719/控制器/ mainh.py,第108行,goodStocks
goodStocks = memcache.get(goodStocks)
文件/ base / python_runtime / python_lib / versions / 1 / google / appengine / api / memcache /__init__.py,第574行,获取
结果= rpc.get_result()
文件/base/python_runtime/python_lib/versions/1/google/appengine/api/apiproxy_stub_map.py,第592行,在get_result
返回self .__ get_result_hook(self)
文件/base/python_runtime/python_lib/versions/1/google/appengine/api/memcache/__init__.py,第639行,in __get_hook
self._do_unpickle)
文件/base/python_runtime/python_lib/versions/1/google/appengine/api/memcache/__init__.py,第271行,在_decode_value
返回do_unpickle(value)
文件/base/python_runtime/python_lib/versions/1/google/appengine/api/memcache/__init__.py,行412,位于_do_unpickle
返回unpickler.load()
文件 /base/python_runtime/python_dist/lib/python2.5/pickle.py,第852行,载入
dispatch [key](self)
文件/ base / python_runtime / python_dist / lib / python2 .5 / pickle.py,第1084行,在load_global
klass = self.find_class(模块,名称)
文件/base/python_runtime/python_dist/lib/python2.5/pickle.py ,第1119行,在find_class中
klass = getattr(mod,name)
AttributeError:'module'object has no attribute'Stock'
股票是我的模型中的一类。我在本地主机上测试了python 2.5。
发生错误的行是对memcache(get function)的访问。
我已更改该项目,也许我放入memcache的数据类型是不同的。我有一些方法可以清理memcache上的数据吗?
有什么想法?
解决方案从版本1.6.4开始,管理控制台中有一个Memcache查看器。它包含一个Flush Cache按钮,它应该完全符合你的需求。
I am getting this error just in production. On localhost it works well.
Traceback (most recent call last):
File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/_webapp25.py", line 701, in __call__
handler.get(*groups)
File "/base/data/home/apps/s~ordenaacoes/2.357768699674437719/controllers/mainh.py", line 74, in get
'stocks': goodStocks(),
File "/base/data/home/apps/s~ordenaacoes/2.357768699674437719/controllers/mainh.py", line 108, in goodStocks
goodStocks = memcache.get("goodStocks")
File "/base/python_runtime/python_lib/versions/1/google/appengine/api/memcache/__init__.py", line 574, in get
results = rpc.get_result()
File "/base/python_runtime/python_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 592, in get_result
return self.__get_result_hook(self)
File "/base/python_runtime/python_lib/versions/1/google/appengine/api/memcache/__init__.py", line 639, in __get_hook
self._do_unpickle)
File "/base/python_runtime/python_lib/versions/1/google/appengine/api/memcache/__init__.py", line 271, in _decode_value
return do_unpickle(value)
File "/base/python_runtime/python_lib/versions/1/google/appengine/api/memcache/__init__.py", line 412, in _do_unpickle
return unpickler.load()
File "/base/python_runtime/python_dist/lib/python2.5/pickle.py", line 852, in load
dispatch[key](self)
File "/base/python_runtime/python_dist/lib/python2.5/pickle.py", line 1084, in load_global
klass = self.find_class(module, name)
File "/base/python_runtime/python_dist/lib/python2.5/pickle.py", line 1119, in find_class
klass = getattr(mod, name)
AttributeError: 'module' object has no attribute 'Stock'
Stock is one class of my models. I tested with python 2.5 on localhost too.
The line that gives the error is the access to memcache (get function).
I have changed the project and maybe the type of the data I put in memcache is different. Do I have some way to clean the data on memcache?
Any idea?
解决方案
As of release 1.6.4 there is a Memcache Viewer in the Admin Console. It includes a "Flush Cache" button that should do exactly what you need.
这篇关于App Engine Python:AttributeError:'模块'对象没有属性'Stock'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!