rotatingfilehandler django code example Example: django rotatingfilehandler if DEBUG and os.environ.get('RUN_MAIN', None) != 'true': LOGGING = {}