I am having trouble figuring out how to return a template together with another value.
My view function looks like this:
@app.route('/', methods=['GET', 'POST'])
def index():
page = request.args.get('page')
return render_template('index.html', page=page)
This works fine, the problem I have is that I also need to return the value of page outside the template for another purpose but I have not been able to:
Here is an example of what I tried:
return render_template('index.html', page=page) and page
This does not work, any help will be appreciated