Course Content

  • Routers

Course Content

FAQs

  • Variable types that can be accepted by routes include:
  • string: Accepts any text that does not begin with a slash (the default).
  • integer: This type accepts integers.
  • float: Accepts decimal numbers with decimal points.
  • path: Similar to a string, but with the exception that it permits slashes.

App Routing is the process of mapping URLs to a specific function that will handle the URL's logic. To assist consumers remember URLs and make navigation easier, modern web frameworks utilise more meaningful URLs. We utilise the app to bind a function to a URL path.

Route parameters are a way to pass data from the URL to the endpoint. Route parameters can be used as a query string or as a part of the path. The route parameters in Python Flask are defined by using a colon (:) followed by an identifier. The identifier is then passed to the endpoint as a variable.

There are two types of route parameter passing:

  • The first is the param object that is passed to an action, this param object includes all the parameters that have been declared in the route.
  • The second type of parameter passing is when you specify a named parameter in an action, this allows for more flexibility and cleaner code.

Recommended Courses

Share With Friend

Have a friend to whom you would want to share this course?

Download LearnVern App

App Preview Image
App QR Code Image
Code Scan or Download the app
Google Play Store
Apple App Store
598K+ Downloads
App Download Section Circle 1
4.57 Avg. Ratings
App Download Section Circle 2
15K+ Reviews
App Download Section Circle 3
  • Learn anywhere on the go
  • Get regular updates about your enrolled or new courses
  • Share content with your friends
  • Evaluate your progress through practice tests
  • No internet connection needed
  • Enroll for the webinar and join at the time of the webinar from anywhere