'Returns the saved device id or creates a new one and saves it.'

def _get_device_id(self):

    device_id = self.cache.get('device_id')
    if (not device_id):
        char_set = (string.ascii_letters + string.digits)
        device_id = ''.join(random.sample(char_set, 32))
        self.cache.set('device_id', device_id, (((365 * 24) * 60) * 60))
    return device_id
