I want to read a INI file from python, and I came up with the following script:
import webapp2
import urllib
import ConfigParser
class MainPage(webapp2.RequestHandler):
def get(self):
getstreet = self.request.get('street')
getlocation = self.request.get('location')
self.response.headers['Content-Type'] = 'text/plain'
map = ConfigParser.RawConfigParser()
map.read('Map.ini')
coords = map.get(getlocation, getstreet)
self.response.out.write(coords)
app = webapp2.WSGIApplication([('/map', MainPage)],
debug=True)
From outside I just need to read:
xxx.appspot.com/map?location=mylocation&street=mystreet
And I double checked the INI file is uploaded and available:
xxx.appspot.com/Map.ini
It works just fine locally, but I get an error when deploying.
I've seen mentions of url fetch, but all examples I could find were the other way around
Any idea?