old_contents: # -*- coding: utf-8 -*-
  from __future__ import print_function
  from __future__ import unicode_literals
  from __future__ import division
  
  from django.contrib.auth.models import User
  from django.shortcuts import render_to_response
  from rest_framework import serializers, viewsets
  
  
  # Serializers define the API representation.
  class UserSerializer(serializers.HyperlinkedModelSerializer):
      class Meta:
          model = User
          fields = ('url', 'username', 'email', 'is_staff')
  
  
  # ViewSets define the view behavior.
  class UserViewSet(viewsets.ModelViewSet):
      queryset = User.objects.all()
      serializer_class = UserSerializer
  
  
  def home_page(request):
      return render_to_response('home/home.html')
  
  
  def compare(request):
      return render_to_response('home/compare.html')
  
new_contents: # -*- coding: utf-8 -*-
  from __future__ import print_function
  from __future__ import unicode_literals
  from __future__ import division
  
  from django.contrib.auth.models import User
  from django.shortcuts import render_to_response
  from django.template.context_processors import csrf
  from rest_framework import serializers, viewsets
  
  
  # Serializers define the API representation.
  class UserSerializer(serializers.HyperlinkedModelSerializer):
      class Meta:
          model = User
          fields = ('url', 'username', 'email', 'is_staff')
  
  
  # ViewSets define the view behavior.
  class UserViewSet(viewsets.ModelViewSet):
      queryset = User.objects.all()
      serializer_class = UserSerializer
  
  
  def home_page(request):
      csrf_token = {}
      csrf_token.update(csrf(request))
  
      return render_to_response('home/home.html', csrf_token)
  
  
  def compare(request):
      return render_to_response('home/compare.html')
subject: Return a csrf token on the homepage.