November 2014
Intermediate to advanced
258 pages
5h 15m
English
At times, we might have to parse the various parts of a URL in different parts. For example, our URL can have an integer part, a string part, a string part of specific length, slashes in the URL, and so on. We can parse all these combinations in our URLs using URL converters. In this recipe, we will see how to do this. Also, we will learn how to implement pagination using the Flask-SQLAlchemy extension.
We have already seen several instances of basic URL converters. In this recipe, we will look at some advanced URL converters and learn how to use them.
Let's say we have a URL route defined as follows:
@app.route('/test/<name>')
def get_name(name):
return nameHere, http://127.0.0.1:5000/test/Shalabh ...
Read now
Unlock full access