Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle App Engine datastore POST not working
    primarykey
    data
    text
    <p>I'm having a problem getting a simple form to post using the datastore. I'm just trying to store RSS feeds, starting with just the name (sourceName) and the link (sourceLink). The form loads and I can enter text in both fields, but when I hit Submit, I get a 404 error. I'm sticking pretty close to the Guestbook tutorial so I'm a bit flummoxed. Here's the form code:</p> <pre><code>import cgi import urllib #from google.appengine.api import users from google.appengine.ext import ndb import webapp2 MAIN_PAGE_FOOTER_TEMPLATE = """\ &lt;form action="/newURL%s" enctype="multipart/form-data" method="post"&gt; &lt;div&gt;&lt;textarea name="sourceName" rows="1" cols="60"&gt;&lt;/textarea&gt;&lt;/div&gt; &lt;div&gt;&lt;textarea name="sourceLink" rows="1" cols="60"&gt;&lt;/textarea&gt;&lt;/div&gt; &lt;div&gt;&lt;input type="submit" value="Submit"&gt;&lt;/div&gt; &lt;/form&gt; &lt;hr&gt; &lt;/body&gt; &lt;/html&gt; """ </code></pre> <p>Here's the rest of it, excluding the MainPage code, which seems to be loading fine.</p> <pre><code>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) </code></pre> <p>yaml:</p> <pre><code>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 </code></pre> <p>I've tried it both including newURL in the yaml and not including it.</p> <p>From the log:</p> <pre><code>"POST /newURL%s HTTP/1.1" 404 188 "http://myrssapp.appspot.com/RSSFeeds </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    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