python - Google App Engine datastore POST not working -
i'm having problem getting simple form post using datastore. i'm trying store rss feeds, starting name (sourcename) , link (sourcelink). form loads , can enter text in both fields, when hit submit, 404 error. i'm sticking pretty close guestbook tutorial i'm bit flummoxed. here's form code:
import cgi import urllib #from google.appengine.api import users google.appengine.ext import ndb import webapp2 main_page_footer_template = """\ <form action="/newurl%s" enctype="multipart/form-data" method="post"> <div><textarea name="sourcename" rows="1" cols="60"></textarea></div> <div><textarea name="sourcelink" rows="1" cols="60"></textarea></div> <div><input type="submit" value="submit"></div> </form> <hr> </body> </html> """
here's rest of it, excluding mainpage code, seems loading fine.
class feedlist(webapp2.requesthandler): def post(self): feedlist_name = self.request.get('feedlist_name', default_feedlist_name) feed = rssfeed(parent=feedlist_key(feedlist_name)) feed.sourcename = self.request.get('sourcename') feed.sourcelink = self.request.get('sourcelink') feed.put() query_params = {'feedlist_name': feedlist_name} self.redirect('/?' + urllib.urlencode(query_params)) app = webapp2.wsgiapplication([ ('/rssfeeds', mainpage), ('/newurl', feedlist)], debug=true)
yaml:
application: myrssapp version: 1 runtime: python27 api_version: 1 threadsafe: yes handlers: - url: /updaterss/daily script: updaterss.app login: admin - url: /searchquery script: searchquery.app - url: /rssfeeds script: rsssources.app - url: /newurl script: rsssources.app - url: /.* script: searchquery.app
i've tried both including newurl in yaml , not including it.
from log:
"post /newurl%s http/1.1" 404 188 "http://myrssapp.appspot.com/rssfeeds
Comments
Post a Comment