I’m using a standard couple of lines of code to retrieve a key from a http get request and use it to get something from the datastore, but am running into a problem that I haven’t encountered before. This is only happening on the live (deployed) version – there are no problems when running the code on the dev server.
The code snippet:
imgId = self.request.args.get("img_id")
imageInfo = db.get(imgId)
And an error example:
BadKeyError: Invalid string key ahFjeWJlcm5hdXRzcHJvamVjdHINCxIFSW1hZ2UY1oYDDA=. Details: Incorrect padding
If I log the value of imgId right before the db.get, it is correct (without the appended “=” from the debug message). Does anyone know what might be causing this?
I’m guessing url encoding.
try:
maybe spaces?
try: