Course Content

  • Routers

Course Content

FAQs

App routing is a technique for mapping a certain URL to a function that is supposed to do a specific activity. It is used to navigate to a certain page in the online application, such as the Flask Tutorial.

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. Decorator of routes.

All you have to do is use the /var> syntax (or the /converter:var> syntax if appropriate) to decorate your view functions. By default, when Flask extracts a variable from a URL for a dynamic route like the one you're trying to utilise, it'll be a Python unicode string.

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.

To run Python code, use the python command line interface with the -c option. Then, using import flask, import the flask package, and output the Flask version, which is provided by the flask. __version__ variable. You've set up a virtual environment and installed Flask in the project folder.

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