Djanog URL variable type

1, character type

  Matches any non-empty string, but does not contain the diagonals. If you do not specify the type, the default is to use this type.

2, integer

  Match 0 and positive integers

3、slug

  The concept can be interpreted as a comment and so on, subsidiary or suffix. Often as interpretative character of RUL. Matches any ASCII character as well as connectors and underscores URL to make more clear and understandable.

4、uuid

  A matching object uuid format. In order to prevent conflicts, requiring the use of a dash and all letters must be lowercase.

According to the above four types of variables, URL can be written in the following form:

  path ( ' <year>/<iηt:month>/<slug:day> ' , views.mydate)

Guess you like

Origin www.cnblogs.com/wuhengood/p/11284241.html