updated code to run on Django 1.6 (1.6.2).

I made changes based on what errors I found.