Django Book 翻译
菜单>:
TOC
返回
原文:
You should exclude the expected slash at the beginning of the ``'^time/$'`` expression in order to match ``/time/`` . Django automatically puts a slash before every expression. At first glance, this may seem odd, but URLconfs can be included in other URLconfs, and leaving off the leading slash simplifies matters. This is further covered in Chapter 8.
翻译:
不必在 ``'^time/$'`` 前加斜杠(/)来匹配 ``/time/`` , 因为 Django 会自动在每个表 达式前添加一个斜杠。乍看起来,这好像有点奇怪,但是 URLconfs 可能由其它的 URLconfs 所引用, 所以不加前面的斜杠可让事情简单一些。这一点在第 8 章中将有进一步阐述。
备注:
译者: