Closed LaBrie13 closed 8 years ago
Put
os.environ["PARSE_API_ROOT"] = "http://server:1337/parse"
at the top of the script, BEFORE you make any imports from parse_rest
You should also put the keys before the imports
The proper order is here: https://github.com/milesrichardson/ParsePy#using-with-self-hosted-parse-server
so the full script would be:
import os
os.environ["PARSE_API_ROOT"] = "http://server:1337/parse"
APPLICATION_ID = '###'
REST_API_KEY = '###'
MASTER_KEY = '###'
from parse_rest.datatypes import Function, Object, GeoPoint
from parse_rest.connection import register
register(APPLICATION_ID, REST_API_KEY, master_key=MASTER_KEY)
id = "1234"
parseClass = Object.factory("Classname")
newObj = parseClass.Query.get(objectId = id)
Let me know if that fixes it
Thanks a lot for your quick response! So simple, but it really saved me! :+1:
no problem :)
I have a weird issue, which just came up lately without a change in the script. What I will describe can be executed in the python console most of the times, not always. I am using self hosted parse. the code is as follows:
by executing this I get an error: "ResourceRequestLoginRequired" , unauthorized
any idea? Your help is very much appreciated! :-)