首先,在app.yaml中添加
- url: /remote_api
script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py
login: admin
添加test_loader.py
import datetime
from google.appengine.ext import db
from google.appengine.tools import bulkloaderclass Test(db.Model):
id = db.IntegerProperty()
name = db.StringProperty()
desc = db.StringProperty()class TestLoader(bulkloader.Loader):
def init(self):
bulkloader.Loader.init(self, ‘Test’,
[(‘id’, int)
,(‘name’, str)
,(‘desc’,lambda x: unicode(x, “utf-8”))
])loaders = [TestLoader]
上传批处理命令
cd C:\Program Files\Google\google_appengine
appcfg.py upload_data –config_file=test_loader.py –filename=test.csv –kind=Test –auth_domain=xxx.com –url=http://www.xxx.com/remote_api D:\xxx
尝试尝试在尝试。终于好了。基本上是按照官方文档来的,但是不管是不小心还是咋滴,总会有问题。但是所幸,功夫不负有心人!!