def redirect_to_message(title, html, http_status_code=None, context=None):
 message_id = generate_hash(length=8)
 message = {u'context': (context or {}), u'http_status_code': (http_status_code or 200)}
 message[u'context'].update({u'header': title, u'title': title, u'message': html})
 cache().set_value(u'message_id:{0}'.format(message_id), message, expires_in_sec=60)
 location = u'/message?id={0}'.format(message_id)
 if (not getattr(local, u'is_ajax', False)):
  local.response[u'type'] = u'redirect'
  local.response[u'location'] = location
 else:
  return location

def redirect_to_message ( title , html , http_status_code = None , context = None ) : message_id = generate_hash ( length = 8 ) message = { u'context' : ( context or { } ) , u'http_status_code' : ( http_status_code or 200 ) } message [ u'context' ] . update ( { u'header' : title , u'title' : title , u'message' : html } ) cache ( ) . set_value ( u'message_id:{0}' . format ( message_id ) , message , expires_in_sec = 60 ) location = u'/message?id={0}' . format ( message_id ) if ( not getattr ( local , u'is_ajax' , False ) ) : local . response [ u'type' ] = u'redirect' local . response [ u'location' ] = location else : return location
redirects to /message?id=random similar to respond_as_web_page .