{"title":"报告问题和请求新功能","version":"6.0","locale":"zh-hans","docname":"internals/contributing/bugs-and-features","url":"/zh-hans/6.0/internals/contributing/bugs-and-features/","canonical":"https://djangodocs.dev/zh-hans/6.0/internals/contributing/bugs-and-features/","summary":"另外，在向工单系统报告问题和请求新功能前，请考虑以下几点：在工单系统上搜索或自定义查询，避免其他人已经提交了相同的问题或功能请求、不要在工单系统上提出支持问…","html":"<h1>报告问题和请求新功能<a class=\"heading-anchor\" href=\"#reporting-bugs-and-requesting-features\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<aside class=\"admonition admonition-important\" role=\"note\">\n<p class=\"admonition-title\">Important</p>\n<p>请将安全问题 <strong>仅</strong> 报告给 <a class=\"reference external\" href=\"mailto:security&#37;&#52;&#48;djangoproject&#46;com\">security<span>&#64;</span>djangoproject<span>&#46;</span>com</a>。 这是一个只对长期以来高度可信的 Django 开发者开放的私人列表，其档案不公开。更多细节，请参见 <a class=\"reference internal\" href=\"/zh-hans/6.0/internals/security/\"><span class=\"doc\">我们的安全政策</span></a>。</p>\n</aside>\n<section id=\"reporting-bugs\">\n<span id=\"id1\"></span><h2>报告问题<a class=\"heading-anchor\" href=\"#reporting-bugs\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>另外，在向 <a class=\"reference external\" href=\"https://code.djangoproject.com/\">工单系统</a> 报告问题和请求新功能前，请考虑以下几点：</p>\n<ul class=\"simple\">\n<li><p>在工单系统上 <a class=\"reference external\" href=\"https://code.djangoproject.com/query\">搜索</a> 或 <a class=\"reference external\" href=\"https://code.djangoproject.com/search\">自定义查询</a> ，避免其他人已经提交了相同的问题或功能请求。</p></li>\n<li><p>不要在工单系统上提出支持问题，请使用 <a class=\"reference external\" href=\"https://chat.djangoproject.com\">Django 论坛</a> 或 <a class=\"reference external\" href=\"https://forum.djangoproject.com/\">Django Discord服务器</a>。</p></li>\n<li><p>不要重新打开已标记为“不会修复”的问题，除非在 <a class=\"reference external\" href=\"https://forum.djangoproject.com/\">Django Forum</a> 达成了重新打开的共识。</p></li>\n<li><p>不要重新打开已标记为“需要新功能流程”的问题，除非通过 GitHub 项目 <a class=\"reference external\" href=\"https://github.com/orgs/django/projects/24/\">new feature ideas</a> 引导了问题。</p></li>\n<li><p>不要在工单系统上进行长篇的讨论，因为它们很可能会被丢失。如果某一工单是具有争议的，请前往 <a class=\"reference external\" href=\"https://forum.djangoproject.com/\">Django 论坛</a> 讨论。</p></li>\n</ul>\n<p>编写良好的 Bug 报告是非常有帮助的。不过，在 Bug 追踪系统中处理它们需要一定的开销。因此，我们希望您能尽量提交有用处的 Bug 报告。具体地：</p>\n<ul class=\"simple\">\n<li><p><strong>请</strong> 先阅读 <a class=\"reference internal\" href=\"/zh-hans/6.0/faq/\"><span class=\"doc\">FAQ</span></a> 寻找答案</p></li>\n<li><p><strong>请</strong> <em>先</em> 在 <a class=\"reference external\" href=\"https://forum.djangoproject.com/\">Django Forum</a> 或 <a class=\"reference external\" href=\"https://chat.djangoproject.com\">Django Discord服务器</a>  上提问，如果不确定你遇到的问题是否是 Bug。</p></li>\n<li><p><strong>请</strong> 编写完整、可复现的、具体的 bug 报告。你必须简洁且清楚地描述所遇到的问题，并提供复现所需要的步骤。尽可能多地提供代码片段、测试用例、异常回溯、截图等调试信息。一个简洁明了的测试用例是最好的报告 bug 的方法，因为它能让我们快速地确认 bug。</p></li>\n<li><p><strong>请不要</strong> 只因为想要提交bug报告而向 <a class=\"reference external\" href=\"https://forum.djangoproject.com/\">Django Forum</a> 发送邮件。 所有 bug 报告都会被发送到 <a class=\"reference internal\" href=\"/zh-hans/6.0/internals/mailing-lists/#django-updates-mailing-list\"><span class=\"std std-ref\">django-updates</span></a> 这个邮件列表。开发者和感兴趣的社区成员都会跟踪这个邮件列表，你提交了我们就能看到。</p></li>\n</ul>\n<p>要了解你创建的工单的生命周期，请参阅 <a class=\"reference internal\" href=\"/zh-hans/6.0/internals/contributing/triaging-tickets/#triage-workflow\"><span class=\"std std-ref\">分类工作流</span></a>。</p>\n<section id=\"reporting-user-interface-bugs\">\n<h3>报告用户界面的 bug<a class=\"heading-anchor\" href=\"#reporting-user-interface-bugs\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>如果你的 bug 或功能请求涉及任何视觉上的东西，则要遵守一些额外的指导：</p>\n<ul class=\"simple\">\n<li><p>在工单中包含相当于最小测试样例的截图。请明确说明问题所在，而不是炫耀对浏览器的定制。</p></li>\n<li><p>如果这个问题很难用图片展示，考虑制作一段简短的屏幕录像。如果你使用的软件支持，最好只录制屏幕上相关的区域。</p></li>\n<li><p>如果你提交了一个改变 Django UI 或行为的补丁，你**必须**附上应用该补丁*前后*的屏幕截图或录像，否则审核人员难以快速评估更改。</p></li>\n<li><p>即使提供了屏幕截图，也请你仍然遵守其它的惯例。请一定提交相关的 URL 和代码片断，以及复现截图所示行为需要的步骤。</p></li>\n<li><p>请给你的工单打上 &quot;UI/UX&quot; 的标记，以便感兴趣的人能找到你的工单。</p></li>\n<li><p>如果问题与可访问性相关，请在适用的情况下链接到相关的 <a class=\"reference internal\" href=\"/zh-hans/6.0/internals/contributing/accessibility/#accessibility-standards\"><span class=\"std std-ref\">accessibility standard</span></a>。</p></li>\n</ul>\n</section>\n</section>\n<section id=\"requesting-features\">\n<span id=\"id2\"></span><h2>请求的功能<a class=\"heading-anchor\" href=\"#requesting-features\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>我们一直致力于让 Django 变得更好，而你们提出的功能请求是关键的一部分。以下几点能让你更有效地提出功能请求：</p>\n<ul class=\"simple\">\n<li><p>确认这个特性真的需要改动 Django 的核心。如果你的想法能通过独立的应用或模块实现（比如说你希望支持另一个数据库引擎），我们可能会建议你独立地开发它。而当你的项目获得足够的社区支持时，我们可能会考虑将它纳入 Django。</p></li>\n<li><p>在GitHub项目的 <a class=\"reference external\" href=\"https://github.com/orgs/django/projects/24/\">new feature ideas</a> 中（而非工单追踪系统）通过在 <strong>Idea</strong> 栏创建新条目来提议该特性。这里是社区和 <a class=\"reference internal\" href=\"/zh-hans/6.0/internals/organization/#steering-council\"><span class=\"std std-ref\">管理委员会</span></a> 评估Django生态系统新想法的地方。对于大型或复杂的提案，这一步尤为重要。我们倾向于在任何开发开始前讨论对Django核心的重大变更。在某些情况下，某功能可能更适合作为第三方包，这样它就能独立于Django的发布周期而演进。</p></li>\n<li><p>清楚而简洁地描述缺少的功能以及您希望如何实施。 如果可能，请包括示例代码（没有功能也可）。</p></li>\n<li><p>解释 <em>为什么</em> 你喜欢这个特性。给出一个一个最小可用的例子可以让其他人理解它能被纳入，以及如果有其它办法实现相同的效果。</p></li>\n</ul>\n<p>另请参阅： <a class=\"reference internal\" href=\"/zh-hans/6.0/internals/contributing/writing-documentation/#documenting-new-features\"><span class=\"std std-ref\">记录新功能</span></a>。</p>\n</section>\n<section id=\"requesting-performance-optimizations\">\n<h2>请求性能优化<a class=\"heading-anchor\" href=\"#requesting-performance-optimizations\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>性能回归报告，或建议的性能优化，应提供基准和命令，以便检查员可以重现。</p>\n<p>有关 Django 现有基准的更多详细信息，请参阅 <a class=\"reference internal\" href=\"/zh-hans/6.0/internals/contributing/writing-code/submitting-patches/#django-asv-benchmarks\"><span class=\"std std-ref\">django-asv 基准测试</span></a>。</p>\n</section>\n<section id=\"how-we-make-decisions\">\n<span id=\"id3\"></span><h2>我们如何作出决定<a class=\"heading-anchor\" href=\"#how-we-make-decisions\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>只要有可能，我们的目标就是达成大致共识。在Github项目 <a class=\"reference external\" href=\"https://github.com/orgs/django/projects/24/\">new feature ideas</a> 中，采用 Emoji 反应来追踪社区反馈。以下是每种反应对应的含义：</p>\n<ul class=\"simple\">\n<li><p>👍: 我支持此功能并会使用它</p></li>\n<li><p>👎: 我反对这个功能，或者认为它会给我或 Django 带来问题</p></li>\n<li><p>😕: 我对这个功能没有强烈的意见</p></li>\n<li><p>🎉: 这个功能似乎是一个简单而有益的补充</p></li>\n</ul>\n<p><a class=\"reference internal\" href=\"/zh-hans/6.0/internals/organization/#steering-council\"><span class=\"std std-ref\">管理委员会</span></a> 会定期审核项目中的提案，将获得社区支持的提案推进并通过以下阶段：</p>\n<ul class=\"simple\">\n<li><p>提案</p></li>\n<li><p>已批准 - 提案细化 - 团队创建</p></li>\n<li><p>进行中</p></li>\n<li><p>解决方案 - 审核 - 反馈</p></li>\n<li><p>需要维护者（仅限Django）</p></li>\n<li><p>完成</p></li>\n</ul>\n<p>偶尔，Django 论坛上可能会讨论功能想法或 Django 的方向。这些讨论可能包括非正式投票，它遵循 Apache 发明并在 Python 上使用的投票风格，投票方式为 +1、+0、-0 或 -1。粗略翻译，这些投票意味着：</p>\n<ul class=\"simple\">\n<li><p>+1: &quot;我喜欢这个想法，强烈支持。&quot;</p></li>\n<li><p>+0: &quot;看起来没问题。&quot;</p></li>\n<li><p>-0: &quot;我不觉得特别好，不过也不反对。&quot;</p></li>\n<li><p>-1: &quot;我强烈反对。如果这个想法变成了现实，我会很不高兴。&quot;</p></li>\n</ul>\n<p>虽然这些投票是非正式的，但它们将被认真对待。在适当的投票期后，如果出现明显的共识，我们将遵循投票结果。</p>\n</section>\n<section id=\"how-to-test-pre-release-versions-of-django\">\n<span id=\"testing-pre-releases\"></span><h2>How to test pre-release versions of Django<a class=\"heading-anchor\" href=\"#how-to-test-pre-release-versions-of-django\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Testing pre-releases is a great way to contribute to Django. Early testers\nhelp catch bugs before the final release, ensuring a smoother upgrade\nexperience for everyone.</p>\n<section id=\"prerequisites\">\n<h3>先决条件<a class=\"heading-anchor\" href=\"#prerequisites\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Before testing a pre-release, it is important that your project is running\nsmoothly on the latest stable release of Django. That way, any regressions can\nbe attributed to the pre-release. See the <a class=\"reference internal\" href=\"/zh-hans/6.0/howto/upgrade-version/\"><span class=\"doc\">如何将 Django 更新至新的版本</span></a> guide\nfor instructions on getting up to date.</p>\n<p>To ensure your project is ready, you should also:</p>\n<ul>\n<li><p><strong>Read the release notes:</strong> Review the <a class=\"reference internal\" href=\"/zh-hans/6.0/releases/\"><span class=\"doc\">发行说明</span></a> for the\nupcoming version to learn about upgrade paths for deprecated features or\nabout minor backward-incompatible changes.</p></li>\n<li><p><strong>Resolve deprecation warnings:</strong> Run your tests with deprecation warnings\nenabled to become aware of required follow-up actions:</p>\n<div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</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=\"Shell code\"><code><span class=\"gp\">$ </span>python -Wa manage.py <span class=\"nb\">test</span>\n</code></pre></div>\n</li>\n</ul>\n</section>\n<section id=\"testing-your-project\">\n<h3>Testing your project<a class=\"heading-anchor\" href=\"#testing-your-project\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>You can install the latest pre-release using <code class=\"docutils literal notranslate\">pip</code>:</p>\n<div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</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=\"Shell code\"><code><span class=\"gp\">$ </span>python -m pip install --pre Django\n</code></pre></div>\n<p>Once installed, run your project's test suite. Rather than just checking\nif tests pass, try the following:</p>\n<ul class=\"simple\">\n<li><p><strong>Check dependency support:</strong> Determine whether major dependencies support\nthe new version by checking Django version classifiers on PyPI.\nSince those projects also value early bug reports, don't let a lack\nof support prevent you from testing.</p></li>\n<li><p><strong>Monitor performance:</strong> You can run your tests with the <a class=\"reference internal\" href=\"/zh-hans/6.0/ref/django-admin/#cmdoption-test-durations\"><code class=\"xref std std-option docutils literal notranslate\">test\n--durations</code></a> flag to identify potential performance regressions.</p></li>\n<li><p><strong>Automate tests in CI:</strong> Consider running your Continuous Integration (CI)\npipeline with the pre-release version.</p></li>\n<li><p><strong>Test manually:</strong> While automated tests are great, manually testing your\napplication's main workflows is an important part of verifying compatibility\nwith a new release.</p></li>\n</ul>\n</section>\n<section id=\"reporting-issues\">\n<h3>Reporting issues<a class=\"heading-anchor\" href=\"#reporting-issues\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>If you discover a bug, please report it via the <a class=\"reference external\" href=\"https://code.djangoproject.com/\">Django issue tracker</a> so it can be fixed before the final\nrelease. When creating the ticket, be sure to set the Django version field to\nthe exact pre-release version you are testing.</p>\n<p>If you suspect a regression, it's helpful to report the specific commit that\ncaused it. See <a class=\"reference internal\" href=\"/zh-hans/6.0/internals/contributing/triaging-tickets/#bisecting-a-regression\"><span class=\"std std-ref\">平等回归</span></a> for instructions.</p>\n<p>You can also discuss any issues or share feedback in the <a class=\"reference external\" href=\"https://forum.djangoproject.com/c/announcements/prereleases/32\">Pre-releases</a> category\non the <a class=\"reference external\" href=\"https://forum.djangoproject.com/\">Django Forum</a>.</p>\n</section>\n</section>","rootId":"reporting-bugs-and-requesting-features","toc":[{"title":"报告问题","anchor":"reporting-bugs","children":[{"title":"报告用户界面的 bug","anchor":"reporting-user-interface-bugs","children":[]}]},{"title":"请求的功能","anchor":"requesting-features","children":[]},{"title":"请求性能优化","anchor":"requesting-performance-optimizations","children":[]},{"title":"我们如何作出决定","anchor":"how-we-make-decisions","children":[]},{"title":"How to test pre-release versions of Django","anchor":"how-to-test-pre-release-versions-of-django","children":[{"title":"先决条件","anchor":"prerequisites","children":[]},{"title":"Testing your project","anchor":"testing-your-project","children":[]},{"title":"Reporting issues","anchor":"reporting-issues","children":[]}]}],"breadcrumbs":[{"docname":"internals/index","title":"Django内部","url":"/zh-hans/6.0/internals/"},{"docname":"internals/contributing/index","title":"为 Django 做贡献","url":"/zh-hans/6.0/internals/contributing/"}],"prev":{"docname":"internals/contributing/localizing","title":"使 Django 本地化","url":"/zh-hans/6.0/internals/contributing/localizing/"},"next":{"docname":"internals/contributing/triaging-tickets","title":"分类工单","url":"/zh-hans/6.0/internals/contributing/triaging-tickets/"},"formats":{"html":"/zh-hans/6.0/internals/contributing/bugs-and-features/","markdown":"/zh-hans/6.0/internals/contributing/bugs-and-features.md","json":"/zh-hans/6.0/internals/contributing/bugs-and-features.json"},"source":"https://github.com/django/django/blob/stable/6.0.x/docs/internals/contributing/bugs-and-features.txt","official":"https://docs.djangoproject.com/zh-hans/6.0/internals/contributing/bugs-and-features/","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","sv","zh-hans","ga","fr","ja","id","it","pt-br","ko","es","el","pl"]}