{"title":"提交补丁","version":"4.1","locale":"zh-hans","docname":"internals/contributing/writing-code/submitting-patches","url":"/zh-hans/4.1/internals/contributing/writing-code/submitting-patches/","canonical":"https://djangodocs.dev/zh-hans/4.1/internals/contributing/writing-code/submitting-patches/","summary":"我们总是感谢Django代码的补丁。确实，具有相关补丁的错误报告将比没有补丁的错误报告 更 快地得到修复。 错字修复和琐碎的文档更改 Link to this heading # If you are fixing a really trivial issue, for example changing a word in…","html":"<h1>提交补丁<a class=\"heading-anchor\" href=\"#submitting-patches\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p>我们总是感谢Django代码的补丁。确实，具有相关补丁的错误报告将比没有补丁的错误报告 <em>更</em> 快地得到修复。</p>\n<section id=\"typo-fixes-and-trivial-documentation-changes\">\n<h2>错字修复和琐碎的文档更改<a class=\"heading-anchor\" href=\"#typo-fixes-and-trivial-documentation-changes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>If you are fixing a really trivial issue, for example changing a word in the\ndocumentation, the preferred way to provide the patch is using GitHub pull\nrequests without a Trac ticket.</p>\n<p>有关如何使用拉取请求的更多详细信息，请参见:doc:working-with-git</p>\n</section>\n<section id=\"claiming-tickets\">\n<h2>“发布”工单<a class=\"heading-anchor\" href=\"#claiming-tickets\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>在一个全球有数百个贡献者的开源项目中，有效地管理沟通以避免重复工作并尽可能提高贡献者的效率是非常重要的。</p>\n<p>因此，我们的政策是供贡献者“发布”工单，以便让其他开发人员知道正在处理特定的错误或功能。</p>\n<p>如果您确定了要做出的贡献并且有能力解决（通过编程能力，Django内核知识水平和时间可用性来衡量），请按照以下步骤进行发表：</p>\n<ul class=\"simple\">\n<li><p><a class=\"reference external\" href=\"https://code.djangoproject.com/github/login\">Login using your GitHub account</a> or <a class=\"reference external\" href=\"https://www.djangoproject.com/accounts/register/\">create an account</a> in our ticket\nsystem. If you have an account but have forgotten your password, you can\nreset it using the <a class=\"reference external\" href=\"https://www.djangoproject.com/accounts/password/reset/\">password reset page</a>.</p></li>\n<li><p>如果尚无此问题的工单，请在我们的 <a class=\"reference external\" href=\"https://code.djangoproject.com/\">ticket tracker</a> 工单追踪系统中创建一个。</p></li>\n<li><p>If a ticket for this issue already exists, make sure nobody else has\nclaimed it. To do this, look at the &quot;Owned by&quot; section of the ticket.\nIf it's assigned to &quot;nobody,&quot; then it's available to be claimed.\nOtherwise, somebody else may be working on this ticket. Either find another\nbug/feature to work on, or contact the developer working on the ticket to\noffer your help. If a ticket has been assigned for weeks or months without\nany activity, it's probably safe to reassign it to yourself.</p></li>\n<li><p>Log into your account, if you haven't already, by clicking &quot;GitHub Login&quot;\nor &quot;DjangoProject Login&quot; in the upper left of the ticket page.</p></li>\n<li><p>Claim the ticket by clicking the &quot;assign to myself&quot; radio button under\n&quot;Action&quot; near the bottom of the page, then click &quot;Submit changes.&quot;</p></li>\n</ul>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Note</p>\n<p>Django软件基金会要求对Django贡献不小的补丁的人签署并提交 <a class=\"reference external\" href=\"https://www.djangoproject.com/foundation/cla/\">Contributor License Agreement</a> 贡献者许可协议，以确保Django软件基金会对所有贡献都拥有明确的许可，从而为所有用户提供明确的许可。</p>\n</aside>\n<section id=\"ticket-claimers-responsibility\">\n<h3>工单发表者的责任<a class=\"heading-anchor\" href=\"#ticket-claimers-responsibility\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>发布工单后，您有责任以合理及时的方式处理该工单。 如果您没有时间来处理它，请先取消发布或不发布它！</p>\n<p>如果一两周内没有任何关于特定已发布工单的进展迹象，则另一位开发人员可能会要求您放弃该发布了的工单，以使其不再被垄断，而其他人也可以发布。</p>\n<p>如果您已发布工单，并且要花很长时间（几天或几周）编写代码，请通过在工单上发布评论来使每个人都保持最新状态。如果您不提供定期更新，并且不响应进度报告的请求，则您对工单的要求可能会被撤消。</p>\n<p>与往常一样，多交流好过少交流！</p>\n</section>\n<section id=\"which-tickets-should-be-claimed\">\n<h3>应该发布哪类工单？<a class=\"heading-anchor\" href=\"#which-tickets-should-be-claimed\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Going through the steps of claiming tickets is overkill in some cases.</p>\n<p>In the case of small changes, such as typos in the documentation or small bugs\nthat will only take a few minutes to fix, you don't need to jump through the\nhoops of claiming tickets. Submit your patch directly and you're done!</p>\n<p>It is <em>always</em> acceptable, regardless whether someone has claimed it or not, to\nsubmit patches to a ticket if you happen to have a patch ready.</p>\n</section>\n</section>\n<section id=\"patch-style\">\n<span id=\"id1\"></span><h2>补丁的风格<a class=\"heading-anchor\" href=\"#patch-style\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>确保您所做的任何贡献至少满足以下要求：</p>\n<ul class=\"simple\">\n<li><p>解决问题或添加功能所需的代码是补丁的重要组成部分，但不是唯一的部分。 一个好的补丁程序还应该包括一个 <span class=\"xref std std-doc\">regression test 1</span> 回归测试以验证已修复的行为并防止问题再次出现。 另外，如果某些工单与您编写的代码相关，请在测试中的一些注释中提及工单编号，以便在提交补丁程序并关闭工单后可以轻松地追溯相关的讨论。</p></li>\n<li><p>如果与修补程序关联的代码添加了新功能或修改了现有功能的行为，则该修补程序还应包含文档。</p></li>\n</ul>\n<p>When you think your work is ready to be reviewed, send <a class=\"reference internal\" href=\"/zh-hans/4.1/internals/contributing/writing-code/working-with-git/\"><span class=\"doc\">a GitHub pull\nrequest</span></a>. Please review the patch yourself using our\n<a class=\"reference internal\" href=\"#patch-review-checklist\"><span class=\"std std-ref\">patch review checklist</span></a> first.</p>\n<p>If you can't send a pull request for some reason, you can also use patches in\nTrac. When using this style, follow these guidelines.</p>\n<ul class=\"simple\">\n<li><p>Submit patches in the format returned by the <code class=\"docutils literal notranslate\"><span class=\"pre\">git</span> <span class=\"pre\">diff</span></code> command.</p></li>\n<li><p>使用“附加文件”按钮将补丁附加到 <a class=\"reference external\" href=\"https://code.djangoproject.com/\">ticket tracker</a> 工单跟踪系统中的工单上。 除非是单行补丁，否则请 <em>不要</em> 将补丁放入工单描述或注释中。</p></li>\n<li><p>用扩展名 <code class=\"docutils literal notranslate\"><span class=\"pre\">.diff</span></code> 命名补丁文件； 这将使工单跟踪系统应用正确的语法突出显示，这非常有帮助。</p></li>\n</ul>\n<p>无论您以何种方式提交工作成果，请按照以下步骤操作。</p>\n<ul class=\"simple\">\n<li><p>Make sure your code fulfills the requirements in our <a class=\"reference internal\" href=\"#patch-review-checklist\"><span class=\"std std-ref\">patch review\nchecklist</span></a>.</p></li>\n<li><p>Check the &quot;Has patch&quot; box on the ticket and make sure the &quot;Needs\ndocumentation&quot;, &quot;Needs tests&quot;, and &quot;Patch needs improvement&quot; boxes aren't\nchecked. This makes the ticket appear in the &quot;Patches needing review&quot; queue\non the <a class=\"reference external\" href=\"https://dashboard.djangoproject.com/\">Development dashboard</a>.</p></li>\n</ul>\n</section>\n<section id=\"non-trivial-patches\">\n<h2>不一般的补丁<a class=\"heading-anchor\" href=\"#non-trivial-patches\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>A &quot;non-trivial&quot; patch is one that is more than a small bug fix. It's a patch\nthat introduces Django functionality and makes some sort of design decision.</p>\n<p>If you provide a non-trivial patch, include evidence that alternatives have\nbeen discussed on <a class=\"reference internal\" href=\"/zh-hans/4.1/internals/mailing-lists/#django-developers-mailing-list\"><span class=\"std std-ref\">django-developers</span></a>.</p>\n<p>If you're not sure whether your patch should be considered non-trivial, ask on\nthe ticket for opinions.</p>\n</section>\n<section id=\"deprecating-a-feature\">\n<span id=\"id2\"></span><h2>Deprecating a feature<a class=\"heading-anchor\" href=\"#deprecating-a-feature\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>There are a couple of reasons that code in Django might be deprecated:</p>\n<ul class=\"simple\">\n<li><p>If a feature has been improved or modified in a backwards-incompatible way,\nthe old feature or behavior will be deprecated.</p></li>\n<li><p>Sometimes Django will include a backport of a Python library that's not\nincluded in a version of Python that Django currently supports. When Django\nno longer needs to support the older version of Python that doesn't include\nthe library, the library will be deprecated in Django.</p></li>\n</ul>\n<p>As the <a class=\"reference internal\" href=\"/zh-hans/4.1/internals/release-process/#internal-release-deprecation-policy\"><span class=\"std std-ref\">deprecation policy</span></a> describes,\nthe first release of Django that deprecates a feature (<code class=\"docutils literal notranslate\"><span class=\"pre\">A.B</span></code>) should raise a\n<code class=\"docutils literal notranslate\"><span class=\"pre\">RemovedInDjangoXXWarning</span></code> (where XX is the Django version where the feature\nwill be removed) when the deprecated feature is invoked. Assuming we have good\ntest coverage, these warnings are converted to errors when <a class=\"reference internal\" href=\"/zh-hans/4.1/internals/contributing/writing-code/unit-tests/#running-unit-tests\"><span class=\"std std-ref\">running the\ntest suite</span></a> with warnings enabled:\n<code class=\"docutils literal notranslate\"><span class=\"pre\">python</span> <span class=\"pre\">-Wa</span> <span class=\"pre\">runtests.py</span></code>. Thus, when adding a <code class=\"docutils literal notranslate\"><span class=\"pre\">RemovedInDjangoXXWarning</span></code>\nyou need to eliminate or silence any warnings generated when running the tests.</p>\n<p>The first step is to remove any use of the deprecated behavior by Django itself.\nNext you can silence warnings in tests that actually test the deprecated\nbehavior by using the <code class=\"docutils literal notranslate\"><span class=\"pre\">ignore_warnings</span></code> decorator, either at the test or class\nlevel:</p>\n<ol class=\"arabic\">\n<li><p>In a particular test:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"kn\">from</span><span class=\"w\"> </span><span class=\"nn\">django.test</span><span class=\"w\"> </span><span class=\"kn\">import</span> <span class=\"n\">ignore_warnings</span>\n<span class=\"kn\">from</span><span class=\"w\"> </span><span class=\"nn\">django.utils.deprecation</span><span class=\"w\"> </span><span class=\"kn\">import</span> <span class=\"n\">RemovedInDjangoXXWarning</span>\n\n<span class=\"nd\">@ignore_warnings</span><span class=\"p\">(</span><span class=\"n\">category</span><span class=\"o\">=</span><span class=\"n\">RemovedInDjangoXXWarning</span><span class=\"p\">)</span>\n<span class=\"k\">def</span><span class=\"w\"> </span><span class=\"nf\">test_foo</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n    <span class=\"o\">...</span>\n</code></pre></div>\n</li>\n<li><p>For an entire test case:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"kn\">from</span><span class=\"w\"> </span><span class=\"nn\">django.test</span><span class=\"w\"> </span><span class=\"kn\">import</span> <span class=\"n\">ignore_warnings</span>\n<span class=\"kn\">from</span><span class=\"w\"> </span><span class=\"nn\">django.utils.deprecation</span><span class=\"w\"> </span><span class=\"kn\">import</span> <span class=\"n\">RemovedInDjangoXXWarning</span>\n\n<span class=\"nd\">@ignore_warnings</span><span class=\"p\">(</span><span class=\"n\">category</span><span class=\"o\">=</span><span class=\"n\">RemovedInDjangoXXWarning</span><span class=\"p\">)</span>\n<span class=\"k\">class</span><span class=\"w\"> </span><span class=\"nc\">MyDeprecatedTests</span><span class=\"p\">(</span><span class=\"n\">unittest</span><span class=\"o\">.</span><span class=\"n\">TestCase</span><span class=\"p\">):</span>\n    <span class=\"o\">...</span>\n</code></pre></div>\n</li>\n</ol>\n<p>You can also add a test for the deprecation warning:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"kn\">from</span><span class=\"w\"> </span><span class=\"nn\">django.utils.deprecation</span><span class=\"w\"> </span><span class=\"kn\">import</span> <span class=\"n\">RemovedInDjangoXXWarning</span>\n\n<span class=\"k\">def</span><span class=\"w\"> </span><span class=\"nf\">test_foo_deprecation_warning</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n    <span class=\"n\">msg</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;Expected deprecation message&#39;</span>\n    <span class=\"k\">with</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">assertWarnsMessage</span><span class=\"p\">(</span><span class=\"n\">RemovedInDjangoXXWarning</span><span class=\"p\">,</span> <span class=\"n\">msg</span><span class=\"p\">):</span>\n        <span class=\"c1\"># invoke deprecated behavior</span>\n</code></pre></div>\n<p>Finally, there are a couple of updates to Django's documentation to make:</p>\n<ol class=\"arabic simple\">\n<li><p>If the existing feature is documented, mark it deprecated in documentation\nusing the <code class=\"docutils literal notranslate\"><span class=\"pre\">..</span> <span class=\"pre\">deprecated::</span> <span class=\"pre\">A.B</span></code> annotation. Include a short description\nand a note about the upgrade path if applicable.</p></li>\n<li><p>Add a description of the deprecated behavior, and the upgrade path if\napplicable, to the current release notes (<code class=\"docutils literal notranslate\"><span class=\"pre\">docs/releases/A.B.txt</span></code>) under\nthe &quot;Features deprecated in A.B&quot; heading.</p></li>\n<li><p>Add an entry in the deprecation timeline (<code class=\"docutils literal notranslate\"><span class=\"pre\">docs/internals/deprecation.txt</span></code>)\nunder the appropriate version describing what code will be removed.</p></li>\n</ol>\n<p>Once you have completed these steps, you are finished with the deprecation.\nIn each <a class=\"reference internal\" href=\"/zh-hans/4.1/internals/release-process/#term-Feature-release\"><span class=\"xref std std-term\">feature release</span></a>, all\n<code class=\"docutils literal notranslate\"><span class=\"pre\">RemovedInDjangoXXWarning</span></code>s matching the new version are removed.</p>\n</section>\n<section id=\"javascript-patches\">\n<h2>JavaScript patches<a class=\"heading-anchor\" href=\"#javascript-patches\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>For information on JavaScript patches, see the <a class=\"reference internal\" href=\"/zh-hans/4.1/internals/contributing/writing-code/javascript/#javascript-patches\"><span class=\"std std-ref\">JavaScript patches</span></a>\ndocumentation.</p>\n</section>\n<section id=\"patch-review-checklist\">\n<span id=\"id3\"></span><h2>Patch review checklist<a class=\"heading-anchor\" href=\"#patch-review-checklist\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Use this checklist to review a pull request. If you are reviewing a pull\nrequest that is not your own and it passes all the criteria below, please set\nthe &quot;Triage Stage&quot; on the corresponding Trac ticket to &quot;Ready for checkin&quot;.\nIf you've left comments for improvement on the pull request, please tick the\nappropriate flags on the Trac ticket based on the results of your review:\n&quot;Patch needs improvement&quot;, &quot;Needs documentation&quot;, and/or &quot;Needs tests&quot;. As time\nand interest permits, mergers do final reviews of &quot;Ready for checkin&quot; tickets\nand will either commit the patch or bump it back to &quot;Accepted&quot; if further works\nneed to be done. If you're looking to become a merger, doing thorough reviews\nof patches is a great way to earn trust.</p>\n<p>Looking for a patch to review? Check out the &quot;Patches needing review&quot; section\nof the <a class=\"reference external\" href=\"https://dashboard.djangoproject.com/\">Django Development Dashboard</a>.\nLooking to get your patch reviewed? Ensure the Trac flags on the ticket are\nset so that the ticket appears in that queue.</p>\n<section id=\"documentation\">\n<h3>文档<a class=\"heading-anchor\" href=\"#documentation\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p>Does the documentation build without any errors (<code class=\"docutils literal notranslate\"><span class=\"pre\">make</span> <span class=\"pre\">html</span></code>, or\n<code class=\"docutils literal notranslate\"><span class=\"pre\">make.bat</span> <span class=\"pre\">html</span></code> on Windows, from the <code class=\"docutils literal notranslate\"><span class=\"pre\">docs</span></code> directory)?</p></li>\n<li><p>Does the documentation follow the writing style guidelines in\n<a class=\"reference internal\" href=\"/zh-hans/4.1/internals/contributing/writing-documentation/\"><span class=\"doc\">编写文档</span></a>?</p></li>\n<li><p>Are there any <a class=\"reference internal\" href=\"/zh-hans/4.1/internals/contributing/writing-documentation/#documentation-spelling-check\"><span class=\"std std-ref\">spelling errors</span></a>?</p></li>\n</ul>\n</section>\n<section id=\"bugs\">\n<h3>Bugs<a class=\"heading-anchor\" href=\"#bugs\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p>Is there a proper regression test (the test should fail before the fix\nis applied)?</p></li>\n<li><p>If it's a bug that <a class=\"reference internal\" href=\"/zh-hans/4.1/internals/release-process/#supported-versions-policy\"><span class=\"std std-ref\">qualifies for a backport</span></a>\nto the stable version of Django, is there a release note in\n<code class=\"docutils literal notranslate\"><span class=\"pre\">docs/releases/A.B.C.txt</span></code>? Bug fixes that will be applied only to the main\nbranch don't need a release note.</p></li>\n</ul>\n</section>\n<section id=\"new-features\">\n<h3>New Features<a class=\"heading-anchor\" href=\"#new-features\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p>Are there tests to &quot;exercise&quot; all of the new code?</p></li>\n<li><p>Is there a release note in <code class=\"docutils literal notranslate\"><span class=\"pre\">docs/releases/A.B.txt</span></code>?</p></li>\n<li><p>Is there documentation for the feature and is it <a class=\"reference internal\" href=\"/zh-hans/4.1/internals/contributing/writing-documentation/#documenting-new-features\"><span class=\"std std-ref\">annotated\nappropriately</span></a> with\n<code class=\"docutils literal notranslate\"><span class=\"pre\">..</span> <span class=\"pre\">versionadded::</span> <span class=\"pre\">A.B</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">..</span> <span class=\"pre\">versionchanged::</span> <span class=\"pre\">A.B</span></code>?</p></li>\n</ul>\n</section>\n<section id=\"id4\">\n<h3>Deprecating a feature<a class=\"heading-anchor\" href=\"#id4\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>See the <a class=\"reference internal\" href=\"#deprecating-a-feature\"><span class=\"std std-ref\">Deprecating a feature</span></a> guide.</p>\n</section>\n<section id=\"all-code-changes\">\n<h3>All code changes<a class=\"heading-anchor\" href=\"#all-code-changes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p>Does the <a class=\"reference internal\" href=\"/zh-hans/4.1/internals/contributing/writing-code/coding-style/\"><span class=\"doc\">coding style</span></a> conform to our\nguidelines? Are there any  <code class=\"docutils literal notranslate\"><span class=\"pre\">black</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">flake8</span></code>, or <code class=\"docutils literal notranslate\"><span class=\"pre\">isort</span></code> errors? You\ncan install the <a class=\"reference internal\" href=\"/zh-hans/4.1/internals/contributing/writing-code/coding-style/#coding-style-pre-commit\"><span class=\"std std-ref\">pre-commit</span></a> hooks to\nautomatically catch these errors.</p></li>\n<li><p>If the change is backwards incompatible in any way, is there a note\nin the release notes (<code class=\"docutils literal notranslate\"><span class=\"pre\">docs/releases/A.B.txt</span></code>)?</p></li>\n<li><p>Is Django's test suite passing?</p></li>\n</ul>\n</section>\n<section id=\"all-tickets\">\n<h3>All tickets<a class=\"heading-anchor\" href=\"#all-tickets\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p>Is the pull request a single squashed commit with a message that follows our\n<a class=\"reference internal\" href=\"/zh-hans/4.1/internals/contributing/committing-code/#committing-guidelines\"><span class=\"std std-ref\">commit message format</span></a>?</p></li>\n<li><p>Are you the patch author and a new contributor? Please add yourself to the\n<code class=\"docutils literal notranslate\"><span class=\"pre\">AUTHORS</span></code> file and submit a <a class=\"reference external\" href=\"https://www.djangoproject.com/foundation/cla/\">Contributor License Agreement</a>.</p></li>\n</ul>\n</section>\n</section>","rootId":"submitting-patches","toc":[{"title":"错字修复和琐碎的文档更改","anchor":"typo-fixes-and-trivial-documentation-changes","children":[]},{"title":"“发布”工单","anchor":"claiming-tickets","children":[{"title":"工单发表者的责任","anchor":"ticket-claimers-responsibility","children":[]},{"title":"应该发布哪类工单？","anchor":"which-tickets-should-be-claimed","children":[]}]},{"title":"补丁的风格","anchor":"patch-style","children":[]},{"title":"不一般的补丁","anchor":"non-trivial-patches","children":[]},{"title":"Deprecating a feature","anchor":"deprecating-a-feature","children":[]},{"title":"JavaScript patches","anchor":"javascript-patches","children":[]},{"title":"Patch review checklist","anchor":"patch-review-checklist","children":[{"title":"文档","anchor":"documentation","children":[]},{"title":"Bugs","anchor":"bugs","children":[]},{"title":"New Features","anchor":"new-features","children":[]},{"title":"Deprecating a feature","anchor":"id4","children":[]},{"title":"All code changes","anchor":"all-code-changes","children":[]},{"title":"All tickets","anchor":"all-tickets","children":[]}]}],"breadcrumbs":[{"docname":"internals/index","title":"Django internals","url":"/zh-hans/4.1/internals/"},{"docname":"internals/contributing/index","title":"为 Django 做贡献","url":"/zh-hans/4.1/internals/contributing/"},{"docname":"internals/contributing/writing-code/index","title":"编写代码","url":"/zh-hans/4.1/internals/contributing/writing-code/"}],"prev":{"docname":"internals/contributing/writing-code/unit-tests","title":"单元测试集","url":"/zh-hans/4.1/internals/contributing/writing-code/unit-tests/"},"next":{"docname":"internals/contributing/writing-code/working-with-git","title":"使用 Git 和 GitHub 工作","url":"/zh-hans/4.1/internals/contributing/writing-code/working-with-git/"},"formats":{"html":"/zh-hans/4.1/internals/contributing/writing-code/submitting-patches/","markdown":"/zh-hans/4.1/internals/contributing/writing-code/submitting-patches.md","json":"/zh-hans/4.1/internals/contributing/writing-code/submitting-patches.json"},"source":"https://github.com/django/django/blob/stable/4.1.x/docs/internals/contributing/writing-code/submitting-patches.txt","official":"https://docs.djangoproject.com/zh-hans/4.1/internals/contributing/writing-code/submitting-patches/","inVersions":["6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1","3.0","2.2","2.1","2.0"],"inLocales":["en","zh-hans","fr","ja","id","it","pt-br","ko","es","el","pl"]}