From the course: Full Stack Web Development with Flask
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
URL variables - Flask Tutorial
From the course: Full Stack Web Development with Flask
URL variables
- [Instructor] URL variables. In this video, we're going to to take a look at the routing patterns, creating a URL variable, setting default data to a URL variable, and how you pass this data to a template. Let's dive into the code and take a look. So here on the application, I'm going to open this application folder and look in the templates here. So, well, let's just see. I'm going to go and run this application first. So, press Control, back, tick. And then, make sure you are in the virtual environment. Activate. Okay, let's run it. Flask, run. All right, I'm going to go to the browser. And refresh this browser. So that's what we get. Okay, so first, let's talk about this URL variables. Now what that is, is basically let's just say, that when you go to the index page, or the classes page, or the courses page and you can pass some data to this page here through a variable. So on the URL, instead of saying…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Creating the base template8m 28s
-
(Locked)
Creating child templates6m 54s
-
(Locked)
Passing data to the view10m 27s
-
(Locked)
Accessing data via request and response objects1m 37s
-
(Locked)
URL variables6m 34s
-
(Locked)
Working with the GET method9m 46s
-
(Locked)
Working with the POST method3m 2s
-
(Locked)
Sending a JSON response8m 1s
-
-
-
-