我正在尝试使用以下代码将日期存储到内存缓存中:
从日期时间导入日期 从 google.appengine.api.memcache 导入客户端 MEMCACHE_DATE_KEY = '日期' 客户=客户() 定义最后日期(): 返回 client.get(MEMCACHE_DATE_KEY) 定义新日期(): client.set(MEMCACHE_DATE_KEY, date.today())
我收到此错误:
回溯(最近一次通话最后): 文件“manage.py”,第 4 行,在 setup_env(manage_py_env=True) 文件“/Users/benji/Projects/app-engine-patch-sample/common/appenginepatch/aecmd.py”,第 67 行,在 setup_env 补丁全部() 文件“/Users/benji/Projects/app-engine-patch-sample/common/appenginepatch/appenginepatcher/patch.py”,第 29 行,在 patch_all 中 patch_app_engine() 文件“/Users/benji/Projects/app-engine-patch-sample/common/appenginepatch/appenginepatcher/patch.py”,第 520 行,在 patch_app_engine db.Model._meta = _meta(db.Model, ()) 文件“/Users/benji/Projects/app-engine-patch-sample/common/appenginepatch/appenginepatcher/patch.py”,第 258 行,在 __init__ settings.INSTALLED_APPS 文件“/Users/benji/Projects/share-renting-engine/common/zip-packages/django-1.1.zip/django/utils/functional.py”,第 269 行,在 __getattr__ _setup 中的文件“/Users/benji/Projects/share-renting-engine/common/zip-packages/django-1.1.zip/django/conf/__init__.py”,第 40 行 文件“/Users/benji/Projects/share-renting-engine/common/zip-packages/django-1.1.zip/django/conf/__init__.py”,第 73 行,在 __init__ 文件“/Users/benji/Projects/share-renting-engine/common/zip-packages/django-1.1.zip/django/utils/importlib.py”,第 35 行,在 import_module 文件“/Users/benji/Projects/share-renting-engine/settings.py”,第 120 行,在 从 ragenja.settings_post 导入 * 文件“/Users/benji/Projects/app-engine-patch-sample/common/appenginepatch/ragenja/settings_post.py”,第 98 行,在 check_app_imports(应用程序) 文件“/Users/benji/Projects/app-engine-patch-sample/common/appenginepatch/ragenja/settings_post.py”,第 63 行,在 check_app_imports __import__(app, {}, {}, ['']) 文件“/Users/benji/Projects/share-renting-engine/engine/__init__.py”,第 5 行,在 如果 date.today() != last_date(): 文件“/Users/benji/Projects/share-renting-engine/engine/utils/date.py”,第 12 行,在 last_date 返回 client.get(MEMCACHE_DATE_KEY) 文件“/Users/benji/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/memcache/__init__.py”,第 428 行,在 get self._make_sync_call('memcache', 'Get', 请求, 响应) MakeSyncCall 中的文件“/Users/benji/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/apiproxy_stub_map.py”,第 86 行 return stubmap.MakeSyncCall(服务,调用,请求,响应) MakeSyncCall 中的文件“/Users/benji/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/apiproxy_stub_map.py”,第 279 行 断言存根,'没有找到服务“%s”的api代理'%服务 AssertionError: No api proxy found for service "memcache"
如何将 memcache 与 app-engine-patch 一起使用?
谢谢你的时间。