Django 1.1.2 版本发行说明¶
欢迎来到 Django 1.1.2 版本!
这是 Django 1.1 系列的第二个“错误修复”版本,改进了 Django 1.1 代码库的稳定性和性能。
Django 1.1.2 保持与 Django 1.1.0 的向后兼容性,但包含了许多修复和其他改进。对于当前使用或针对 Django 1.1 的任何开发或部署,建议升级到 Django 1.1.2 。
有关 1.1 分支中新功能、向后不兼容性和已弃用功能的详细信息,请参阅 Django 1.1 版本发行说明。
1.1.2 中的不向后兼容的变更¶
测试运行器退出状态码¶
The exit status code of the test runners (tests/runtests.py and python
manage.py test) no longer represents the number of failed tests, since a
failure of 256 or more tests resulted in a wrong exit status code. The exit
status code for the test runner is now 0 for success (no failing tests) and 1
for any number of test failures. If needed, the number of test failures can be
found at the end of the test runner's output.
一个新功能¶
通常,小版本发布不会包括新功能,但在 Django 1.1.2 中,我们对这一规则做了一个例外。Django 1.2(Django 的下一个主要版本)将包含一个改进跨站请求伪造(CSRF)攻击防护的功能。这个功能要求在 Django 渲染的所有表单中使用新的 csrf_token 模板标签。
为了更容易支持相同的模板同时运行在 1.1.X 和 1.2.X 版本的 Django 上,我们决定将 csrf_token 模板标签引入到 1.1.X 分支。在 1.1.X 分支中,csrf_token 没有任何作用 - 它对模板或表单处理没有影响。然而,这意味着相同的模板将能够在 Django 1.2 上正常工作。