A few changes to support Django 1.5

There's some CORS stuff in there too. It may not interest you.