Added a debug code as per jpetto's comment

Simply use settings.DEBUG