From the course: Flask Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Variable rules in URLs

Variable rules in URLs

From the course: Flask Essential Training

Start my 1-month free trial

Variable rules in URLs

- [Instructor] Now, when people have come to visit our website, they've made lots of different short codes with urls and files that they want associated with them. For instance, we have go connected with yahoo dot com. Hello with google dot com. And even if we go to the right here, we can see the house that we just created, which is now associated with a file. So, we have to have the ability so that when someone visits our website slash house, that we display the following file or if they visit our site slash go, it will redirect them to yahoo dot com. So, how do we do this? Well, we need a new route to find these situations when someone has specified these unique urls. And if we go to our app dot py, and we look at the existing routes that we have, we could create a new route that would look, for instance, something like go or house. But, how would we know possibly what someone is going to upload to our site?…

Contents