Submitting contributions¶
We’re always grateful for contributions to Django’s code. Indeed, bug reports with associated contributions will get fixed far more quickly than those without a solution.
오타 수정 및 사소한 문서 변경 사항입니다.¶
설명서에서 단어를 변경하는 등 매우 사소한 문제를 수정하는 경우 패치를 제공하는 기본 방법은 Trac 티켓 없이 GitHub 풀 요청을 사용하는 것입니다.
pull 요청을 사용하는 방법에 대한 자세한 내용은 :doc:’working-with-git’을 참조하십시오.
티켓을 “청구하기”¶
전 세계에 수백 명의 기여자가 있는 오픈소스 프로젝트에서는 작업이 중복되지 않고 기여자가 최대한 효과적으로 작업할 수 있도록 커뮤니케이션을 효율적으로 관리하는 것이 중요합니다.
따라서 우리의 정책은 특정 버그나 기능이 작업 중임을 다른 개발자에게 알리기 위해 티켓을 “청구”하는 기여자를 위한 것입니다.
원하는 기여가 확인되었고 이를 수정할 수 있는 능력이 있는 경우(코딩 능력, Django 내부 지식 및 시간 가용성으로 측정됨) 다음 단계를 수행하여 해당 기여를 청구합니다.
저희 티켓 시스템에서 “GitHub account” 또는 “create account”를 사용하여 로그인하십시오. 계정이 있지만 암호를 잊어버린 경우 ‘비밀번호 재설정 페이지’를 사용하여 재설정할 수 있습니다.
이 문제에 대한 티켓이 아직 존재하지 않는 경우 “티켓 추적기”에 티켓을 만드십시오.
이 문제에 대한 티켓이 이미 있는 경우 다른 사람이 해당 티켓을 청구하지 않았는지 확인하십시오. 이렇게 하려면 티켓의 “소유자” 섹션을 참조하십시오. “아무도”에게 할당된 경우 청구할 수 있습니다. 그렇지 않으면 다른 사람이 이 티켓을 작업하고 있을 수 있습니다. 작업할 다른 버그/기능을 찾거나 티켓 관련 개발자에게 문의하여 도움을 요청하십시오. 몇 주 또는 몇 달 동안 아무런 작업 없이 티켓이 할당된 경우 자신에게 티켓을 다시 할당하는 것이 안전할 수 있습니다.
Log into your account, if you haven’t already, by clicking “GitHub Login” or “DjangoProject Login” in the upper left of the ticket page. Once logged in, you can then click the “Modify Ticket” button near the bottom of the page.
Claim the ticket by clicking the “assign to” radio button in the “Action” section. Your username will be filled in the text box by default.
Finally click the “Submit changes” button at the bottom to save.
참고
The Django software foundation requests that anyone contributing more than a trivial change, to Django sign and submit a Contributor License Agreement, this ensures that the Django Software Foundation has clear license to all contributions allowing for a clear license for all users.
티켓 청구인의 책임입니다.¶
티켓을 수령한 후에는 적시에 해당 티켓을 처리해야 할 책임이 있습니다. 만약 여러분이 그것을 할 시간이 없다면, 그것을 청구하지 않거나, 애초에 청구하지 마세요!
If there’s no sign of progress on a particular claimed ticket for a week or two, another developer may ask you to relinquish the ticket claim so that it’s no longer monopolized and somebody else can claim it.
티켓을 수령했는데 코딩하는 데 오랜 시간(일 또는 몇 주)이 걸리는 경우 티켓에 댓글을 달아 모든 사용자를 최신 상태로 유지하십시오. 정기적인 업데이트를 제공하지 않고 진행 상황 보고서 요청에 응답하지 않으면 티켓에 대한 청구가 취소될 수 있습니다.
항상 그렇듯이, 더 많은 의사소통이 덜 소통하는 것보다 더 낫습니다!
어떤 표를 구해야 합니까?¶
어떤 경우에는 티켓을 청구하는 단계를 거치는 것이 지나치기도 합니다.
In the case of small changes, such as typos in the documentation or small bugs that will only take a few minutes to fix, you don’t need to jump through the hoops of claiming tickets. Submit your changes directly and you’re done!
It is always acceptable, regardless whether someone has claimed it or not, to link proposals to a ticket if you happen to have the changes ready.
Contribution style¶
최소한 다음 요구 사항을 충족하는 기여가 있는지 확인하십시오.
The code required to fix a problem or add a feature is an essential part of a solution, but it is not the only part. A good fix should also include a regression test to validate the behavior that has been fixed and to prevent the problem from arising again. Also, if some tickets are relevant to the code that you’ve written, mention the ticket numbers in some comments in the test so that one can easily trace back the relevant discussions after your patch gets committed, and the tickets get closed.
If the code adds a new feature, or modifies the behavior of an existing feature, the change should also contain documentation.
When you think your work is ready to be reviewed, send a GitHub pull request. If you can’t send a pull request for some reason, you can also use patches in Trac. When using this style, follow these guidelines.
“git diff” 명령으로 반환된 형식으로 패치를 제출합니다.
“첨부 파일” 버튼을 사용하여 “티켓 트래커”의 티켓에 패치를 첨부합니다. 한 줄 패치가 아닌 경우 티켓 설명이나 코멘트에 패치를 넣지 마십시오.
패치 파일의 이름을 “.diff” 확장자로 지정합니다. 이렇게 하면 티켓 추적기가 올바른 구문 강조 표시를 적용할 수 있으므로 매우 유용합니다.
작업 제출 방법과 상관없이 다음 단계를 따르십시오.
Make sure your code fulfills the requirements in our contribution checklist.
티켓의 “패치 있음” 상자를 선택하고 “문서 필요”, “테스트 필요” 및 “패치 개선 필요” 상자를 선택하지 않았는지 확인합니다. 이렇게 하면 티켓이 “개발 대시보드”의 “검토가 필요한 패치” 대기열에 나타납니다.
Contributions which require community feedback¶
A wider community discussion is required when a patch introduces new Django functionality and makes some sort of design decision. This is especially important if the approach involves a deprecation or introduces breaking changes.
The following are different approaches for gaining feedback from the community.
The Django Forum¶
You can propose a change on the Django Forum. You should explain the need for the change, go into details of the approach and discuss alternatives.
Please include a link to such discussions in your contributions.
Third party package¶
Django does not accept experimental features. All features must follow our deprecation policy. Hence, it can take months or years for Django to iterate on an API design.
If you need user feedback on a public interface, it is better to create a third-party package first. You can iterate on the public API much faster, while also validating the need for the feature.
Once this package becomes stable and there are clear benefits of incorporating aspects into Django core, starting a discussion on the Django Forum would be the next step.
Django Enhancement Proposal (DEP)¶
Similar to Python’s PEPs, Django has Django Enhancement Proposals or DEPs. A DEP is a design document which provides information to the Django community, or describes a new feature or process for Django. They provide concise technical specifications of features, along with rationales. DEPs are also the primary mechanism for proposing and collecting community input on major new features.
Before considering writing a DEP, it is recommended to first open a discussion on the Django Forum. This allows the community to provide feedback and helps refine the proposal. Once the DEP is ready the Steering Council votes on whether to accept it.
Some examples of DEPs that have been approved and fully implemented:
기능을 사용¶
Django의 코드가 더 이상 사용되지 않는 몇 가지 이유가 있습니다.
기능이 이전 버전과 호환되지 않는 방식으로 개선되거나 수정된 경우 이전 기능 또는 동작은 더 이상 사용되지 않습니다.
때때로 Django는 Django가 현재 지원하는 Python 버전에 포함되지 않은 Python 라이브러리의 백포트를 포함할 수 있습니다. Django가 라이브러리를 포함하지 않는 이전 버전의 Python을 더 이상 지원할 필요가 없으면 Django에서 라이브러리가 사용되지 않습니다.
:ref:’감가상각 정책’에서 설명한 것처럼 기능을 사용하지 않는 Django의 첫 번째 릴리스(‘’A’)입니다.B’’)는 사용되지 않는 기능이 호출될 때 “제거된 장고 XX 경고”(여기서 XX는 기능이 제거될 장고 버전)를 발생시켜야 합니다. 테스트 범위가 양호하다고 가정하면, 경고가 활성화된 상태에서 :ref:’test Suite’를 실행하면 이러한 경고가 오류로 변환됩니다. ‘’’와 - 와 runtests.py’’’’입니다. 따라서 “RemovedInDjangoXXWarning”을 추가할 때 테스트를 실행할 때 발생하는 경고를 제거하거나 침묵시켜야 합니다.
첫 번째 단계는 Django가 사용하지 않는 동작의 사용을 제거하는 것입니다. 그런 다음 테스트 또는 클래스 수준에서 “ignore_warnings” 데코레이터를 사용하여 권장되지 않는 동작을 실제로 테스트하는 테스트에서 경고를 음소거할 수 있습니다.
특정 테스트의 경우:
from django.test import ignore_warnings from django.utils.deprecation import RemovedInDjangoXXWarning @ignore_warnings(category=RemovedInDjangoXXWarning) def test_foo(self): ...
전체 테스트 사례의 경우:
from django.test import ignore_warnings from django.utils.deprecation import RemovedInDjangoXXWarning @ignore_warnings(category=RemovedInDjangoXXWarning) class MyDeprecatedTests(unittest.TestCase): ...
You should also add a test for the deprecation warning:
from django.utils.deprecation import RemovedInDjangoXXWarning
def test_foo_deprecation_warning(self):
msg = "Expected deprecation message"
with self.assertWarnsMessage(RemovedInDjangoXXWarning, msg) as ctx:
# invoke deprecated behavior
...
self.assertEqual(ctx.filename, __file__)
It’s important to include a RemovedInDjangoXXWarning
comment above code
which has no warning reference, but will need to be changed or removed when the
deprecation ends. This could include hooks which have been added to keep the
previous behavior, or standalone items that are unnecessary or unused when the
deprecation ends. For example:
import warnings
from django.utils.deprecation import RemovedInDjangoXXWarning
# RemovedInDjangoXXWarning.
def old_private_helper():
# Helper function that is only used in foo().
pass
def foo():
warnings.warn(
"foo() is deprecated.",
category=RemovedInDjangoXXWarning,
stacklevel=2,
)
old_private_helper()
...
마지막으로 Django의 문서에는 다음과 같은 몇 가지 업데이트가 있습니다.
기존 기능이 문서화된 경우 ‘’를 사용하여 문서에서 사용되지 않는 것으로 표시합니다. 사용되지 않음: A입니다.B’ 주석입니다. 해당되는 경우 간단한 설명과 업그레이드 경로에 대한 참고 사항을 포함합니다.
권장되지 않는 동작에 대한 설명과 적용 가능한 업그레이드 경로가 있다면 현재 릴리스 정보(‘’docs/releases/A’.B.txt”)를 “A.B에서 사용되지 않는 기능입니다” 헤드에 추가합니다.
제거될 코드를 설명하는 항목을 해당 버전의 사용 중지 타임라인(
docs/internals/deprecation.txt
)에 추가합니다.
이 단계를 완료하면 더 이상 사용되지 않습니다. 각 :term:’feature release’에서 새 버전과 일치하는 모든 “RemovedInDjangoXXWarning”s가 제거된다.
JavaScript contributions¶
For information on JavaScript contributions, see the JavaScript 패치 documentation.
Optimization patches¶
Patches aiming to deliver a performance improvement should provide benchmarks showing the before and after impact of the patch and sharing the commands for reviewers to reproduce.
django-asv
benchmarks¶
django-asv monitors the performance of Django code over time. These
benchmarks can be run on a pull request by labeling the pull request with
benchmark
. Adding to these benchmarks is highly encouraged.
Contribution checklist¶
Use this checklist to review a pull request. If this contribution would not be considered trivial, first ensure it has an accepted ticket before proceeding with the review.
If the pull request passes all the criteria below and is not your own, please set the “Triage Stage” on the corresponding Trac ticket to “Ready for checkin”. If you’ve left comments for improvement on the pull request, please tick the appropriate flags on the Trac ticket based on the results of your review: “Patch needs improvement”, “Needs documentation”, and/or “Needs tests”. As time and interest permits, mergers do final reviews of “Ready for checkin” tickets and will either commit the changes or bump it back to “Accepted” if further work needs to be done.
If you’re looking to become a member of the triage & review team, doing thorough reviews of contributions is a great way to earn trust.
Looking for a patch to review? Check out the “Patches needing review” section of the Django Development Dashboard.
Looking to get your pull request reviewed? Ensure the Trac flags on the ticket are set so that the ticket appears in that queue.
문서¶
문서가 오류 없이 작성됩니까(“docs” 디렉토리에서 Windows의 “make html” 또는 “make.bat html”로 작성됩니까?
문서가 :doc:’/internals/기여/writing-documentation’의 필기 스타일 지침을 따르고 있습니까?
:ref:’철자 오류’가 있습니까?
버그¶
올바른 회귀 테스트가 있습니까(고정을 적용하기 전에 테스트가 실패해야 함)?
:ref:”backport”가 Django의 안정적인 버전에 적합한 버그인 경우 “docs/releases/A.B.C.txt”에 릴리스 노트가 있습니까? 본점에만 적용되는 버그 수정에는 릴리스 노트가 필요하지 않습니다.
새로운 특징들¶
새로운 코드를 모두 “연습”하기 위한 테스트가 있습니까?
“docs/releases/A”에 릴리즈 노트가 있습니까?B.txt’요?
기능에 대한 설명서가 있고 그 설명서가 A.B나 바뀐 버전의 A.B가 있는 적절한 주석이 달린 참고 입니까?
기능을 사용¶
:ref:’decrating-a-feature’ 가이드를 참조하십시오.
모든 코드가 변경됩니다.¶
Does the coding style conform to our guidelines? Are there any
black
,blacken-docs
,flake8
, orisort
errors? You can install the pre-commit hooks to automatically catch these errors.변경 내용이 이전 버전과 호환되지 않는 경우 릴리스 노트(
docs/releases/A.B.txt
)에 참고 사항이 있습니까?장고의 테스트 스위트룸은 합격했나요?
모든 티켓들¶
풀 요청은 :ref:’commit message format’ 뒤에 오는 메시지와 함께 스쿼시된 단일 커밋입니까?
Are you the patch author and a new contributor? Please add yourself to the AUTHORS file and submit a Contributor License Agreement.
Does this have an accepted ticket on Trac? All contributions require a ticket unless the change is considered trivial.