...
Now we'll extend our Google App Engine application to include an admin web application so we can initialize or view the data in the data store from a browser. We'll create a request handler so that we can invoke the Admin
class by sending a GET request to a certain URL, like http://opensocial-gifts-*_username_*.appspot.com/admin?action=init.
Creating a request handler
...
Let's start by creating a request handler that will return the list of gifts in a JSON format. If a request comes in to http://opensocial-gifts-*_username_*.appspot.com/gifts, we should return:
Code Block |
---|
["a cashew nut", "a peanut", "a hazelnut", "a red pistachio nut"] |
...
Up to this point, we've been using the (local) development app server, but in order for an OpenSocial container like orkut or MySpace to access your application spec, the file needs to be hosted publicly. From the google_appengine
directory, run ./appcfg.py update <your_app_directory>;
from the application directory to publish your app. After the upload is complete, make sure you can access the OpenSocial application spec XML file at http://opensocial-gifts-*_username_*/static/gifts.xml from your browser.
Requesting friends
...