add optional argument to recast() to set the type of an object
fix settings for recent django versions