LOGGING = copy.deepcopy(DEFAULT_LOGGING)
LOGGING['filters']['suppress_deprecated'] = {'()':
    'mysite.settings.SuppressDeprecated'}
LOGGING['handlers']['console']['filters'].append('suppress_deprecated')


class SuppressDeprecated(logging.Filter):

    def filter(self, record):
        WARNINGS_TO_SUPPRESS = ['RemovedInDjango18Warning',
            'RemovedInDjango19Warning']
return not any([(warn in record.getMessage()) for warn in WARNINGS_TO_SUPPRESS]
    )
How to suppress the deprecation warnings in Django?