django 1.7 support

There were a few minor issues with running 1.7

I have not thoroughly test this but it seems to be working fine.