Note that there are some explanatory texts on larger screens.

plurals
  1. POProperty lat must be a float displaying in my dashboard
    primarykey
    data
    text
    <p>I have created a Google AppEngine Project which takes in a .txt file, finds locations within the file and uses Yahoo Placemaker to plot a maker on the map to represent the .txt file. The project works fine when I run in on my localhost but when I try and upload it to appspot I get an error:</p> <blockquote> <p>BadValueError: Property lat must be a float</p> </blockquote> <p>My main.py looks like this: </p> <pre><code>class Story(db.Model): id = db.StringProperty() loc_name = db.StringProperty() title = db.StringProperty() lat = db.FloatProperty() long = db.FloatProperty() link = db.StringProperty() class MyStories(webapp.RequestHandler): def get(self): temp = db.Query(Story) temp = temp.count() story_set = Story.all() template_values = { 'storyTemp': story_set } path = os.path.join(os.path.dirname(__file__), 'index.html') self.response.out.write(template.render(path, template_values)) class place(webapp.RequestHandler): def get(self): path = '/Users/kimmasterson/storing/txtFiles' try: for infile in glob.glob(os.path.join(path, '*.txt')): #print infile f = open(infile, 'r') data = f.read() newfile = infile.replace('.txt', '') newfile = newfile.replace('/Users/kimmasterson/storing/txtFiles/', '') #print newfile storyname = 'http://www.independent.ie/national-news/' + newfile #print storyname #print newfile #logging.info(data) p = placemaker('HSnG9pPV34EUBcexz.tDYuSrZ8Hnp.LowswI7TxreF8sXrdpVyVIKB4uPGXBYOA9VjjF1Ca42ipd_KhdJsKYjI5cXRo0eJM-') print p.find_places(data) for place in p.places: splitted = place.name.split() for word in splitted: temp = db.Query(Story) temp = temp.filter("link = ", storyname) results = temp.fetch(limit=1) if len(results) &gt;0: break elif 'IE' in word: print temp print 'success' story = Story(name=newfile, lat=place.centroid.latitude, long=place.centroid.longitude, link=storyname, loc_name = place.name, title = newfile).put() except: print 'error' logging.info('BIG FAT ERROR') def main(): application = webapp.WSGIApplication([('/', MyStories), ('/place', place)], debug=True) wsgiref.handlers.CGIHandler().run(application) if __name__ == '__main__': main() </code></pre> <p>My cron.yaml:</p> <pre><code>cron: - description: running place url: /place schedule: every day 10:00 </code></pre> <p>For some reason it adds the places and links the file to the map on my localhost. Any ideas how the same code in both places can work in one and not in the other?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload