There are two vyushki. One gets an input from the user on the page, creates a dictionary, draws the page and gives the data to the created dictionary to another view that works further with it. How can I transfer a dictionary from one input to another.
@app.route("/game/") def game(): # сюда я должен его получит и проделать с ним манипуляцииreturn render_template('game.html', data=data) @app.route("/") def page(): num = request.args.get("num") if num: data = {"field": get_field(int(num)), "num": int(num),"chord": "0", "empty": '.', 'x': 'x', 'o': 'o', "moves": 1} return render_template('game.html', data=data) # эта создаёт словарь return render_template('first_page.html') And provided that in HTML I work through links: by type:
{% else %} <span><a href="{{ url_for('game')}}"> <img src="{{ url_for('static', filename='img/main.png') }}" width='30px' height='15px'/></a>