Exception fix

cc @lukmdo @trepca @iserko 

This is for Django 1.6 compat. The first commit is the important one.