def publish(msg): data = jsonify(msg) addr = settings.OWS_NOTIFY_PUB_ADDR sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) try: sock.sendto(data, addr) except Exception, e: logger.warning('notification publish failed: %s', e)
def jsonify(value): return mark_safe(utils.jsonify(value))