Rating system

Each user (when logged in) can rate movies simply by clicking on the rate value (1 to 5) at the side of the movie title in the movies' results page (see preceding screenshot). This action will trigger the rate_movie function in the views.py file (through the corresponding URL in urls.py):

def rate_movie(request): data = request.GET rate = data.get("vote") movies,moviesindxs = zip(*literal_eval(data.get("movies"))) movie = data.get("movie") movieindx = int(data.get("movieindx")) #save movie rate userprofile = None if request.user.is_superuser: return render_to_response( 'books_recsys_app/superusersignin.html', RequestContext(request)) elif request.user.is_authenticated() : userprofile = UserProfile.objects.get(user=request.user) else: ...

Get Machine Learning for the Web now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.