Added a compatibility shim for exception subclassing on Django 1.4