def set_maintenance_mode(value):
    """
    Set maintenance_mode state to state file.
    """

    # If maintenance mode is defined in settings, it can't be changed.
    if settings.MAINTENANCE_MODE is not None:
        raise ImproperlyConfigured(
            'Maintenance mode cannot be set dynamically '
            'if defined in settings.')

    if not isinstance(value, bool):
        raise TypeError('value argument type is not boolean')

    backend = get_maintenance_mode_backend()
    backend.set_value(value)
def set_maintenance_mode ( value ) : if settings . MAINTENANCE_MODE is not None : raise ImproperlyConfigured ( 'Maintenance mode cannot be set dynamically ' 'if defined in settings.' ) if not isinstance ( value , bool ) : raise TypeError ( 'value argument type is not boolean' ) backend = get_maintenance_mode_backend ( ) backend . set_value ( value )
Set maintenance_mode state to state file.