def render(rnd, board_id=1): # Trigger a redraw. requester = Requester() with requester.requests(): requester.update_board(board_id) requester.submit(rnd) # Get the image. img = rnd.get_png(board_id) # Return as PNG output = io.BytesIO(img) return output
def render(): # TODO: find board id? board_id = 1 # Trigger a redraw. requester = Requester() with requester.requests(): requester.update_board(board_id) requester.submit(RENDERER) # Get the image. img = RENDERER.get_png(1) # Return as PNG output = io.BytesIO(img) return send_file(output, mimetype='image/png', as_attachment=False)