Django 的发行流程¶
- 功能发行¶
Feature releases contain new features, improvements to existing features, and other enhancements. Each version will be mostly backwards compatible with the previous release. Exceptions to this rule will be listed in the release notes.
- 补丁发行¶
A release containing bug fixes and/or security fixes, issued as needed.
These releases will be 100% compatible with the associated feature release, unless this is impossible for security reasons or to prevent data loss, in which case the release notes will provide detailed upgrade instructions. Generally, you should always upgrade to the latest patch release. Each patch release supersedes earlier patch releases in its series, which may contain known security vulnerabilities.
- 长期支持发行¶
Under the
A.Bversioning scheme, certain feature releases are designated as long-term support (LTS) releases. These releases receive security and data loss fixes for three years.Starting with Django 2028, there are no separate LTS releases. All feature releases receive security and data loss fixes for three years: one year of mainstream support followed by two years of extended support. See the annual release cycle for more details.
See the download page for the
A.Breleases that have been designated for long-term support.
正式发行¶
Since version 1.0, and ending with Django 6.2, Django's release numbering works as follows:
版本编号为
A.B或A.B.C形式。A.Bis the feature release version number.Cis the patch release version number.在一个新的功能发行之前,我们会发布 alpha、beta 和候选发行。这些发行的形式是
A.B alpha/beta/rc N,意思是A.B版本的第N个 alpha/beta/候选发行。
在 git 中,每个 Django 发行都会有一个标签,表示它的版本号,用 Django 的发行密钥签名。此外,每个发行系列都有自己的分支,称为 stable/A.B.x,bugfix/security 版本将从这些分支发布。
For more information about how the Django project issues new releases for security purposes, please see our security policies.
Django 6.2 is the last release using this numbering scheme and release cadence. Please see the annual release cycle for details on the new release process.
发行节奏¶
From Django 2.0, and ending with Django 6.2, version numbers use a loose form of semantic versioning such that each version following a long-term support release will bump to the next "dot zero" version. For example: 2.0, 2.1, 2.2 (LTS), 3.0, 3.1, 3.2 (LTS), etc.
SemVer makes it easier to see at a glance how compatible releases are with each
other. It also helps to anticipate when compatibility shims will be removed.
It's not a pure form of SemVer as each feature release will continue to have a
few documented backwards incompatibilities where a deprecation path isn't
possible or not worth the cost. Also, deprecations started in an LTS release
(X.2) will be dropped in a non-dot-zero release (Y.1) to accommodate
our policy of keeping deprecation shims for at least two feature releases. Read
on to the next section for an example.
废弃政策¶
A feature release may deprecate certain features from previous releases. If a
feature is deprecated in feature release A.x, it will continue to work in
all A.x versions (for all versions of x) but raise warnings. Deprecated
features will be removed in the B.0 release, or B.1 for features
deprecated in the last A.x feature release to ensure deprecations are done
over at least 2 feature releases.
因此,举例来说,如果我们决定在 Django 4.2 中开始废止一个函数:
Django 4.2 将包含一个向后兼容的函数副本,它将引发一个
RemovedInDjango51Warning。Django 5.0(4.2 之后的版本)仍将包含向后兼容的副本。
Django 5.1 将直接删除该功能。
这些警告在默认情况下是静默的。你可以用 python -Wd 选项打开这些警告的显示。
一个更普遍的例子:
X.0X.1X.2LTSY.0: Drop deprecation shims added inX.0andX.1.Y.1: Drop deprecation shims added inX.2.Y.2LTS: No deprecation shims dropped (whileY.0is no longer supported, third-party apps need to maintain compatibility back toX.2LTS to ease LTS to LTS upgrades).Z.0: Drop deprecation shims added inY.0andY.1.
Features deprecated in Django 6.0, 6.1, or 6.2 are removed following the same rules, with Django 2028 taking the place of 7.0 and Django 2029 taking the place of 7.1. Features deprecated in Django 2028 or later follow the annual release cycle deprecation policy.
也请参见 弃用一个功能 指南。
支持的版本¶
在任何时候,Django 的开发者团队都会在不同程度上支持一系列的版本。请参阅下载页面的 支持的版本部分 ,了解每个版本的当前支持情况。
目前的开发分支
main将获得需要少量重构的新功能和错误修复。Patches applied to the
mainbranch must also be applied to the last feature release branch, to be released in the next patch release of that feature series, when they fix critical problems:安全问题。
数据丢失漏洞。
崩溃漏洞。
最新稳定发行的新功能中的主要功能漏洞。
在当前版本系列中引入的旧版本 Django 的缺陷。
经验法则是,对于那些一开始就会阻止发行的漏洞(发行障碍),修复将被向后移植到最后一个功能发行。
Security fixes and data loss bugs will be applied to the current
mainbranch and all supported feature release branches.一般来说,文档修复会更自由地向后移植到最后一个发行分支。这是因为让最后一个发行的文档是最新的和正确的是非常有利的,而且引入缺陷的风险也更小。
作为一个具体的例子,考虑在 Django 5.1 和 5.2 发布之间的一个时间点。在这个时间点上:
Features will be added to the development
mainbranch, to be released as Django 5.2.关键漏洞修复将应用于
stable/5.1.x分支,并作为 5.1.1、5.1.2 等发行。Security fixes and bug fixes for data loss issues will be applied to
mainand to thestable/5.1.x,stable/5.0.x, andstable/4.2.x(LTS) branches. They will trigger the release of 5.1.1, 5.0.5, 4.2.8, etc.文档修复将应用于 main,如果容易向后移植,则应用于最新的稳定分支,
5.1.x。
发行过程¶
Django uses a time-based release schedule. Up to Django 6.2, feature releases happen every eight months or so. From Django 2028, they happen once a year, as described in the annual release cycle.
After each feature release, the release manager will publish a timeline for the next feature release. The timeline for an upcoming feature release can be found in the corresponding roadmap page, e.g. https://www.djangoproject.com/download/6.0/roadmap.
Active development / Pre-feature freeze¶
Work begins on the feature release A.B after the feature freeze of the
previous release, i.e. when the stable/A.B-1.x branch is forked.
You can find the current branch under active development in the Django release process on Trac.
Feature freeze / Alpha release¶
All major and minor features, including deprecations and breaking changes, must be merged by the feature freeze. Any features not done by this point will be deferred to the next feature release.
At this point, the stable/A.B.x branch will be forked from main.
Non-release blocking bug fix freeze / Beta release¶
After the alpha, all bug fixes merged in main are also backported to
stable/A.B.x. Refactors are backported at the discretion of the merger.
Mergers will be more and more conservative with backports, to avoid introducing
regressions.
In parallel to this phase, main can continue to receive new features, to be
released in the A.B+1 cycle.
Translation string freeze / Release candidate release¶
If there is still a consistent stream of release blockers coming in at the planned release candidate date, a beta 2 will be released to encourage further testing and the release candidate date will be pushed out ~1 month.
The release candidate marks the string freeze, and it happens at least two weeks before the final release. Translators can then submit updated translations for inclusion in the final release. After this point, new translatable strings must not be added.
After the release candidate, only release blockers and documentation fixes are backported.
Final release¶
Ideally, the final release will ship two weeks after the last release candidate.
If there are major bugs still being found 2 weeks after the release candidate, there will be a decision on how to proceed (likely another release candidate would be issued and the final release date will be pushed out).
The annual release cycle¶
正式发行¶
Starting with Django 2028, Django's release numbering works as follows:
Versions are numbered in the form
YYYYorYYYY.N.YYYYis the feature release version number, using the four-digit year of release, for example 2028.Nis the patch release version number, incremented with each patch release, for example 2028.1 and 2028.2.Before a new feature release, there are alpha, beta, and release candidate releases, for example 2028 alpha 1, 2028 beta 1, and 2028 rc 1.
In git, each Django release will have a tag indicating its version number,
signed with the Django release key. Additionally, each release series has its
own branch, called stable/YYYY.x, and bugfix/security releases will be
issued from those branches.
For more information about how the Django project issues new releases for security purposes, please see our security policies.
发行节奏¶
One feature release will be made each calendar year. Final releases are planned for approximately the second week of January and use that calendar year's number. The exact release date is at the release manager's discretion.
废弃政策¶
If a feature is deprecated in feature release YYYY, it will continue to
work in the following feature release, YYYY+1, while raising warnings. The
feature will be removed in YYYY+2.
For example, if a feature is deprecated in Django 2028:
Django 2028 will contain the deprecated feature and raise a
RemovedInDjango2030Warning.Django 2029 will continue to contain the deprecated feature.
Django 2030 will remove the feature.
Deprecation warnings are silent by default. You can turn on display of these
warnings with the python -Wd option.
也请参见 弃用一个功能 指南。
支持的版本¶
Each feature release series goes through two support phases:
Mainstream support lasts one year, until the next feature release. During this time, patches applied to
mainare also applied to the release branch when they fix critical problems: security issues, data loss bugs, crashing bugs, major functionality bugs in new features, and regressions introduced in the current release series.Extended support lasts another two years. During this time, only security fixes and data loss fixes are applied.
See the supported versions section of the download page for the current state of support for each version.
As a concrete example, consider a moment in time halfway between the release of Django 2029 and 2030. At this point in time:
Features will be added to the development
mainbranch, to be released as Django 2030 around mid-January 2030.Critical bug fixes will be applied to the
stable/2029.xbranch, and released roughly once a month as patch releases 2029.1, 2029.2, etc.Security fixes and bug fixes for data loss issues will be applied to
mainand to each stable branch still in support, in this case, thestable/2029.x,stable/2028.x, andstable/6.2.x(LTS) branches. They will trigger a patch release for each version e.g. 2029.1, 2028.5, and 6.2.8.Documentation fixes will be applied to
main, and, if easily backported, to the latest stable branch,stable/2029.x.
发行过程¶
Django uses a time-based release schedule, with feature releases every year in January.
After each feature release, the release manager will publish a timeline for the next feature release. The timeline for an upcoming feature release can be found in the corresponding roadmap page, e.g. https://www.djangoproject.com/download/2028/roadmap.
Active development / Pre-feature freeze¶
Work begins on the feature release YYYY after the feature freeze of the
previous release, i.e. when the stable/YYYY-1.x branch is forked. For
Django 2028, the previous release is Django 6.2, so that branch is
stable/6.2.x.
You can find the current branch under active development in the Django release process on Trac.
Feature freeze / Alpha release¶
All major and minor features, including deprecations and breaking changes, must be merged by the feature freeze. Any features not done by this point will be deferred to the next feature release.
At this point, the stable/YYYY.x branch will be forked from main.
Non-release blocking bug fix freeze / Beta release¶
After the alpha, all bug fixes merged in main are also backported to
stable/YYYY.x. Refactors are backported at the discretion of the merger.
Mergers will be more and more conservative with backports, to avoid introducing
regressions.
In parallel to this phase, main can continue to receive new features, to be
released in the YYYY+1 cycle.
Translation string freeze / Release candidate release¶
If there is still a consistent stream of release blockers coming in at the planned release candidate date, a beta 2 will be released to encourage further testing and the release candidate date will be pushed out ~1 month.
The release candidate marks the string freeze, and it happens at least two weeks before the final release. Translators can then submit updated translations for inclusion in the final release. After this point, new translatable strings must not be added.
After the release candidate, only release blockers and documentation fixes are backported.
Final release¶
Ideally, the final release will ship in approximately the second week of January.
If there are major bugs still being found 2 weeks after the release candidate, there will be a decision on how to proceed (likely another release candidate would be issued and the final release date will be pushed out).