Django Book 翻译
菜单>:
TOC
返回
原文:
This code is straightforward. First, it prints a Content-Type line, followed by a blank line, as required by CGI. It prints some introductory HTML, connects to a database and executes a query that retrieves the latest ten books. Looping over those books, it generates an HTML unordered list. Finally, it prints the closing HTML and closes the database connection.
翻译:
代码十分简单。首先,根据CGI的要求输出一行Content-Type,接下来是一个空行。再接下 来是一些HTML的起始标签,然后连接数据库并执行一些查询操作,获取最新的十本书。遍历这些书,同时生成一个 HTML的无序序列。最后,输出HTML的结束标签并且关闭数据库连接。
备注:
译者: