def validate_base64(value):
 try:
  base64.b64decode(value.split()[1])
 except Exception as e:
  raise ValidationError(e)

def validate_base64 ( value ) : try : base64 . b64decode ( value . split ( ) [ 1 ] ) except Exception as e : raise ValidationError ( e )
check that value contains only valid base64 characters .