python routes名词解释

https://routes.readthedocs.io/en/latest/glossary.html
2019.03

component

A part of a URL delimited by slashes. The URL “/help/about” contains two components: “help” and “about”.
成分,组件。url的一部分,用斜杠/分割。url路径/help/about就是由两components组成:help和about。

generation

The act of creating a URL based on a route name and/or variable values. This is the opposite of matching. Finding a route by name is called named generation. Finding a route without specifying a name is called nameless generation.
基于路由名称和/或者变量值创建一个URL的操作行为。这个和匹配(matching,下面有有介绍)操作是相反的。通过名称去发现一个路由,被称为有名称的generation。不使用特定的名字去发现一个路由被称为无名称的generation。

mapper

A container for routes. There is normally one mapper per application, although nested subapplications might have their own mappers. A mapper knows how to match routes and generate them.
一个路由的容器。通常每一个应用程序有一个mapper,尽管嵌套的子应用可能有他们自己的mapper。一个mapper知道如何去匹配路由和生成路由。

matching

The act of matching a given URL against a list of routes, and returning the routing variables. See the route entry for an example.
给出一个URL,根据路由列表进行匹配,并返回路由变量的操作行为。可以查看route这个条目获得一个示例。

minimization

A deprecated feature which allowed short URLs to match long paths. Details are in the Backward Compatibility section in the manual.
一个已经废弃的功能,允许短URLs去匹配长路径。有关详细信息,请参见手册的向后兼容性部分。

route

A rule mapping a URL pattern to a dict of routing variables. For instance, if the pattern is “/{controller}/{action}” and the requested URL is “/help/about”, the resulting dict would be:
将URL规则映射为路由变量字典的规则。比如,如果一个URL规则是“/{controller}/{action}”,请求的URL是 “/help/about”,那么匹配出来的字典就是:
{“controller”: “help”, “action”: “about”}
Routes does not know what these variables mean; it simply returns them to the application. Pylons would look for a controllers/help.py module containing a HelpController class, and call its about method. Other frameworks may do something different.
Routes不知道这些变量的含义;它只是简单地将它们返回到应用程序。Pylons框架将查找controllers/help.py这个模块,包含了一个HelpController 类,可以调用它的about方法。其他的框架可能有不同的做法。

A route may have a name, used to identify the route.
路由可以有一个名称,用于标识路由。

route path

The URL pattern in a route.
route中的路由规则

routing variables

A dict of key-value pairs returned by matching. Variables defined in the route path are called path variables; their values will be taken from the URL. Variables defined outside the route path are called default variables; their values are not affected by the URL.
一个matching匹配后返回的字典。路由路径中定义的变量称为路径变量;它们的值将从URL中获取。路由路径之外定义的变量称为默认变量;它们的值不受URL的影响。

The WSGI.org environment key for routing variables is “wsgiorg.routing_args”. This manual does not use that term because it can be confused with function arguments.
路由变量的WSGI.org环境键是“wsgiorg.routing_args”。本手册不使用该术语,因为它可能与函数参数混淆。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值