I am using Flask-Bootstrap's render_pagination
macro. When I click the page numbers, it changes the URL to have page=2
, but when the page re-renders, the results and page are still for page 1. How do I change the page and results when using render_pagination
?
@app.route('/results')
def results(filename, page=1):
logs = Logs.query.paginate(page)
return render_template('results.html', logs=logs)
{% from "bootstrap/pagination.html" import render_pagination %}
{% for log in logs.items %}
{{ log }}
{% endfor %}
{{ render_pagination(logs) }}