Enabling and overriding debug feature
Don't enable or override an application's debug feature. Instead, use OS environment variables to set up the debug feature.
def detect_activated_debug_feature_noncompliant():
    from django.conf import settings
    # Noncompliant: The debug feature is enabled.
    settings.configure(DEBUG=True)
def detect_activated_debug_feature_compliant():
    from django.conf import settings
    import os
    # Compliant: The debug feature is set through the environment variable.
    settings.configure(DEBUG=os.environ['DEBUG'])