Recommandations

If you are using django and if you want to publish your own music and books recommandations, this article is for you !

Recommandation are easy, you just need a amazon identification number (ASIN) of the product that you want to recommend and the application will do the rest of the job.

Prerequise

To begin, you need an key to access to “Amazon web services and the PyAmazon python library in order to use AWS easily.

You will also need the famous Python Imaging Library to deal with product illustration.

Models

Once those details done, we have to create our model, the save method will search for these information using the ASIN :

Download models.

Views

A simple generic view will do the trick, we are going to just display the 3 latest recommendations with pagination.

We only give 3 args to our view :

Download urls mapping.

Templates

Last step, the template which have acces to these variables :

Download templates.

What’s next ?

You just need to synchronise your database and to add your favorite books and albums !