Django Book 翻译
菜单>:
TOC
返回
原文:
We made two changes here. First, we imported the ``current_datetime`` view from its module (``mysite/views.py`` , which translates into ``mysite.views`` in Python import syntax). Next, we added the line ``(r'^time/$', current_datetime),`` . This line is referred to as a *URLpattern* its a Python tuple in which the first element is a simple regular expression and the second element is the view function to use for that pattern.
翻译:
我们做了两处修改。首先,我们从模块 (在 Python 的 import 语法中, ``mysite/views.py`` 转译为 ``mysite.views`` ) 中引入了 ``current_datetime`` 视图。接着,我们加入了 ``(r'^time/$', current_datetime),`` 这一行。该行就是所谓的 *URLpattern* ,它是一个 Python 元组,其第一个元素是简单的正则表达式,第二个元素是为该模式应用的视图函数。
备注:
译者: