API_ROOT = os.environ.get('PARSE_API_ROOT') or 'https://api.parse.com/1'
修改成
API_ROOT = os.environ.get('PARSE_API_ROOT')
用pip進行安裝
sudo pip3 install git+https://github.com/xxxxxx/ParsePy.git
import os
os.environ["PARSE_API_ROOT"] = "https://your.domain.com/parse"
import datetime
from parse_rest.datatypes import Object
from parse_rest.connection import register
class Student(Object):
pass
APPLICATION_ID = 'AppID'
REST_API_KEY = 'RestKey'
MASTER_KEY = 'MasterKey'
register(APPLICATION_ID, REST_API_KEY, master_key=MASTER_KEY)
s = Student.Query.get(objectId='xxxxaaaa10')
s.name = "C.Y.Fang"
s.math = 60
s.eng = 50
s.cht = 61
s.save()
參考資料:
https://github.com/milesrichardson/ParsePy