The world can only really be changed one piece at a time. The art is picking that piece.
There are many ways you can contribute to Django REST framework. We'd like it to be a community-led project, so please get involved and help shape the future of the project.
Note
At this point in its lifespan we consider Django REST framework to be feature-complete. We focus on pull requests that track the continued development of Django versions, and generally do not accept new features or code formatting changes.
The most important thing you can do to help push the REST framework project forward is to be actively involved wherever possible. Code contributions are often overvalued as being the primary way to get involved in a project, we don't believe that needs to be the case.
If you use REST framework, we'd love you to be vocal about your experiences with it - you might consider writing a blog post about using REST framework, or publishing a tutorial about building a project with a particular JavaScript framework. Experiences from beginners can be particularly helpful because you'll be in the best position to assess which bits of REST framework are more difficult to understand and work with.
Other really great ways you can help move the community forward include helping to answer questions on thediscussion group, or setting up anemail alert on StackOverflow so that you get notified of any new questions with thedjango-rest-framework tag.
When answering questions make sure to help future contributors find their way around by hyperlinking wherever possible to related threads and tickets, and include backlinks from those items if relevant.
Please keep the tone polite & professional. For some users a discussion on the REST framework mailing list or ticket tracker may be their first engagement with the open source community. First impressions count, so let's try to make everyone feel welcome.
Be mindful in the language you choose. As an example, in an environment that is heavily male-dominated, posts that start 'Hey guys,' can come across as unintentionally exclusive. It's just as easy, and more inclusive to use gender neutral language in those situations.
TheDjango code of conduct gives a fuller set of guidelines for participating in community forums.
Our contribution process is that theGitHub discussions page should generally be your starting point. Some tips on good potential issue reporting:
Getting involved in triaging incoming issues is a good way to start contributing. Every single ticket that comes into the ticket tracker needs to be reviewed in order to determine what the next steps should be. Anyone can help out with this, you just need to be willing to
To start developing on Django REST framework, first create a Fork from theDjango REST Framework repo on GitHub.
Then clone your fork. The clone command will look like this, with your GitHubusername instead of YOUR-USERNAME:
git clone https://github.com/YOUR-USERNAME/django-rest-frameworkSee GitHub'sFork a Repo Guide for more help.
Changes should broadly follow thePEP 8 style conventions, and we recommend you set up your editor to automatically indicate non-conforming styles.You can check your contributions against these conventions each time you commit using thepre-commit hooks, which we also run on CI.To set them up, first ensure you have the pre-commit tool installed, for example:
python -m pip install pre-commitThen run:
pre-commit installTo run the tests, clone the repository, and then:
# Setup the virtual environmentpython3 -m venv envsource env/bin/activatepip install -e .pip install -r requirements.txt# Run the tests./runtests.pyTip
If your tests require access to the database, do not forget to inherit fromdjango.test.TestCase or use the@pytest.mark.django_db() decorator.
For example, with TestCase:
from django.test import TestCaseclass MyDatabaseTest(TestCase): def test_something(self): # Your test code here passOr with decorator:
import pytest@pytest.mark.django_db()class MyDatabaseTest: def test_something(self): # Your test code here passYou can reuse existing models defined intests/models.py for your tests.
Run using a more concise output style.
./runtests.py -qIf you do not want the output to be captured (for example, to see print statements directly), you can use the-s flag.
./runtests.py -sRun the tests for a given test case.
./runtests.py MyTestCaseRun the tests for a given test method.
./runtests.py MyTestCase.test_this_methodShorter form to run the tests for a given test method.
./runtests.py test_this_methodNote
The test case and test method matching is fuzzy and will sometimes run other tests that contain a partial string match to the given command line input.
You can also use the excellenttox testing tool to run the tests against all supported versions of Python and Django. Installtox globally, and then simply run:
toxIt's a good idea to make pull requests early on. A pull request represents the start of a discussion, and doesn't necessarily need to be the final, finished submission.
It's also always best to make a new branch before starting work on a pull request. This means that you'll be able to later switch back to working on another separate issue without interfering with an ongoing pull requests.
It's also useful to remember that if you have an outstanding pull request then pushing new commits to your GitHub repo will also automatically update the pull requests.
GitHub's documentation for working on pull requests isavailable here.
Always run the tests before submitting pull requests, and ideally runtox in order to check that your modifications are compatible on all supported versions of Python and Django.
Once you've made a pull request take a look at the build status in the GitHub interface and make sure the tests are running as you'd expect.

Above: build notifications
Sometimes, in order to ensure your code works on various different versions of Django, Python or third party libraries, you'll need to run slightly different code depending on the environment. Any code that branches in this way should be isolated into thecompat.py module, and should provide a single common interface that the rest of the codebase can use.
The documentation for REST framework is built from theMarkdown source files inthe docs directory.
There are many great Markdown editors that make working with the documentation really easy. TheMou editor for Mac is one such editor that comes highly recommended.
To build the documentation, install MkDocs withpip install mkdocs and then run the following command.
mkdocs buildThis will build the documentation into thesite directory.
You can build the documentation and open a preview in a browser window by using theserve command.
mkdocs serveDocumentation should be in American English. The tone of the documentation is very important - try to stick to a simple, plain, objective and well-balanced style where possible.
Some other tips:
There are a couple of conventions you should follow when working on the documentation.
Headers should use the hash style. For example:
### Some important topicThe underline style should not be used.Don't do this:
Some important topic====================Links should always use the reference style, with the referenced hyperlinks kept at the end of the document.
Here is a link to [some other thing][other-thing].More text...[other-thing]: http://example.com/other/thingThis style helps keep the documentation source consistent and readable.
If you are hyperlinking to another REST framework document, you should use a relative link, and link to the.md suffix. For example:
[authentication]: ../api-guide/authentication.mdLinking in this style means you'll be able to click the hyperlink in your Markdown editor to open the referenced document. When the documentation is built, these links will be converted into regular links to HTML pages.
If you want to draw attention to a note or warning, use anadmonition, like so:
!!! note A useful documentation note.The documentation theme stylesinfo,warning,tip anddanger admonition types, but more could be added if the need arise.