这个 url 路径是什么意思?
What is this url path mean?
你好,我是 Django 的新手,我看到一行 path('dashboard/(?P<user>.*)/$'),
。我不明白这一点。我想学习这部分。但是我不知道如何在 google 和 youtube 上搜索这个。
In Python regular expressions, the syntax for named regular expression groups is (?P<name>pattern)
, where name
is the name of the group and pattern
is some pattern to match.
这意味着此 url 的路径在 link 中传递了一个变量用户。所以使用这个路径的每个页面都会在地址栏中有'dashboard/"the_user"/'。
你好,我是 Django 的新手,我看到一行 path('dashboard/(?P<user>.*)/$'),
。我不明白这一点。我想学习这部分。但是我不知道如何在 google 和 youtube 上搜索这个。
In Python regular expressions, the syntax for named regular expression groups is
(?P<name>pattern)
, wherename
is the name of the group andpattern
is some pattern to match.
这意味着此 url 的路径在 link 中传递了一个变量用户。所以使用这个路径的每个页面都会在地址栏中有'dashboard/"the_user"/'。