Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ul>
- {% for x in lk1 %}
- <li><a href="{{ url_for('bookPage'}}">{{ x[2] }} (by) {{ x[3] }} (year) : {{ x[4] }}</a></li>
- {% endfor %}
- </ul>
- <ul>
- {% for x in lk1 %}
- <li><a href="{{ url_for('bookPage', title=x[2] }}">{{ x[2] }} (by) {{ x[3] }} (year) : {{ x[4] }}</a></li>
- {% endfor %}
- </ul>
- @app.route('/books/<title>' )
- # the name of this function have to be used in
- # url_for ('nameOfFunction', name_of_variable_part_of_url=some_internal_variable)
- def bookPage(isbn):
- # code, that will creat yourlist
- # book.html - template for book
- # listofvariables - variables for book's page
- #
- return render_template ("book.html", listofvariables=yourlist)
Add Comment
Please, Sign In to add comment