Django Book 翻译
菜单>:
TOC
返回
原文:
With that view function and URLconf written, start the Django development server (if its not already running), and visit ``http://127.0.0.1:8000/time/plus/3/`` to verify it works. Then try ``http://127.0.0.1:8000/time/plus/5/`` . Then ``http://127.0.0.1:8000/time/plus/24/`` . Finally, visit ``http://127.0.0.1:8000/time/plus/100/`` to verify that the pattern in your URLconf only accepts one- or two-digit numbers; Django should display a Page not found error in this case, just as we saw in the 404 Errors section earlier. The URL ``http://127.0.0.1:8000/time/plus/`` (with *no* hour designation) should also throw a 404.
翻译:
在完成视图函数和URL配置编写后,启动Django开发服务器,用浏览器访问 ``http://127.0.0.1:8000/time/plus/3/`` 来确认它工作正常。 然后是 ``http://127.0.0.1:8000/time/plus/5/`` 。再然后是 ``http://127.0.0.1:8000/time/plus/24/`` 。最后,访问 ``http://127.0.0.1:8000/time/plus/100/`` 来检验URL配置里设置的模式是否只 接受一个或两个数字;Django会显示一个 Page not found error 页面, 和以前看到的 404 错误一样。访问URL ``http://127.0.0.1:8000/time/plus/`` (*没有* 定义时间差) 也会抛出404错误。
备注:
译者: