Archive | Python RSS feed for this section

Set up an Amazon Book Store on Google App Engine – 3 – Display the books list on the results page

24 Feb

This is the third and the final part in the tutorial series, ‘Setting up an Amazon Product Store on Google App Engine’. Please go through the first 2 parts before you continue further. Here are the links:

Okay guys, thank you for your patience and your enthusiasm to learn, and sorry for my ‘very draggy sometimes’ style of writing! This is the last part in this series and we’ll see how to loop through the ‘books’ list for displaying the books properly in a tabular format on the results page.

Create a new file ‘results.html’ in our app’s folder and put the following code in it:

Read More: Setting up an Amazon Book Store on Google App Engine – 3 – Display the books list on the results page

Set up an Amazon Book Store on Google App Engine – 2 – Constructing and Signing the request for Amazon Product Data

24 Feb

This is the part 2 of the ‘Set up an Amazon book store on Google App Engine’ tutorial series. I assume that you have followed the first part of this tutorial, and completed the app along with it. If you haven’t, then please read the first part, complete it before continuing.

We continue from where we left off in the last part, our homepage, the ‘index.html’ file. On our homepage, we have a nice header message welcoming our users. We have a form in our content area for the user to enter a keyword/topic to search books on. The form action is set to ‘/fetch’, we need to handle this in our code.

Modify the ‘amazon.py’ file and add the following code to it:

Read More: Set up an Amazon Book Store on Google App Engine – 2 – Constructing and Signing the request for Amazon Product Data

Set up an Amazon Book Store on Google App Engine – 1

24 Feb

Who said good things don’t come for free? They do! Amazon Product Advertising API and Google App Engine are 2 such powerful things that all web developers should know! Google App Engine lets you host your websites/apps for FREE, completely running on Google’s resources, whereas Amazon Product Advertising API allows you to showcase Amazon’s product data on your website for free, and you get a commission of 5% – 15% per purchase made via your site.

We’ll learn to integrate these 2 services in a single app by setting up an Amazon book store on Google app engine.

Divide the app in 3 parts:
1) Set up the basic structure of our app. Make sure all the request handlers are in place and working.

2) The Amazon part of our app: We learn to construct and sign the request url for getting the book data from Amazon.

3) The templating part. We’ll display the books data in a tabular format on our site.

Prerequisites:
1) Amazon Associates Account: Sign up ‘FREE’ over here: Amazon Associates. You’ll get all the credentials required to access Amazon product data: Access keys, Associate tag etc.

2) Python 2.5 and Google App Engine: Download the GAE sdk for Python from Google App Engine downloads page. It works only with Python 2.5. Download Python 2.5. Install GAE and complete the ‘Hello World’ and ‘Guestbook’ tutorials from the docs for Google App Engine. Those are the best tutorials on getting started with GAE. And most important, this tutorial will assume that you have completed those 2 tutorials, and hence know the folder structure and basic files needed.

3) Python programming skills: Yes, you need to know atleast the basics of Python programming. Loops, conditional statements, lists, dictionaries etc. would do.

4) XML: As we will be dealing with XML data, you should know how an XML doc is and it would be very nice if you know how to parse it in Python ( don’t worry if you don’t know to, we will solve that problem later !)

Demo: Click to see my store in action!

Read More: Set up an Amazon Book Store on Google App Engine – 1

Follow

Get every new post delivered to your Inbox.