Flask 101 Part-4 Flask Routing How to Define and Register URL Route

preview_player
Показать описание
4. Routing :- URL Patterns

In the last video, we saw how to install flask using pip and setup virtual Environment and Simple Hello World Flask Application.

In this Video, We Explore Flask Route or URL Registration Concept.

Note:-
each URL unique so the following rules apply:

1. If a rule ends with a slash and is requested without a slash by the user, the user is automatically redirected to the same page with a trailing slash attached.

ex:- /hello/
2. If a rule does not end with a trailing slash and the user requests the page with a trailing slash, a 404 not found is raised.
ex:- /hell

2. Dynamic Route :- set Type
3. Dynamic Route :- set Defaults
4. Dynamic Route :- With Converter
5. Dynamic Route :- add_url_rule()

In Next Video we will Explore Basic Converter VS Custom Converter and HTTP methods.
Рекомендации по теме