The world can only really be changed one piece at a time. The art is picking that piece.— Tim Berners-Lee
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.
Community
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:- Write a blog post about using REST framework
- Publish a tutorial about building a project with a particular JavaScript framework
- Share your experiences on social media or forums
- Help answer questions on the discussion group
- Set up an email alert on StackOverflow for
django-rest-frameworktag - Hyperlinking to related threads and tickets when answering questions
- Include backlinks from those items if relevant
Code of Conduct
Please keep the tone polite and 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. The Django code of conduct gives a fuller set of guidelines for participating in community forums.Issues
Our contribution process is that the GitHub discussions page should generally be your starting point. This approach allows us to keep down the maintenance overhead of REST framework, so that the focus can be on continued stability and great documentation.Triaging Issues
Getting involved in triaging incoming issues is a good way to start contributing. Every ticket that comes into the tracker needs to be reviewed. You can help by:Reading and Understanding
Reading and Understanding
Read through the ticket - does it make sense? Is it missing context that would help explain it better?
Checking Placement
Checking Placement
Is the ticket in the correct place? Would it be better suited as a discussion on the discussion group?
Reproducing Bugs
Reproducing Bugs
If it’s a bug report, can you reproduce it? Can you write a failing test case that demonstrates the issue?
Evaluating Features
Evaluating Features
If it’s a feature request, could it be implemented as a third-party package instead?
Reviving Stale Tickets
Reviving Stale Tickets
If a ticket hasn’t had much activity and addresses something you need, comment on it and try to get it moving again.
Development
To start developing on Django REST framework, first create a Fork from the Django REST Framework repo on GitHub. Then clone your fork:Code Style
Changes should broadly follow the PEP 8 style conventions. 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 pre-commit hooks:Testing
To run the tests, clone the repository, and then:Test Options
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.
Running Against Multiple Environments
You can use the excellent tox testing tool to run the tests against all supported versions of Python and Django:Pull Requests
It’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.Create a Branch
Always make a new branch before starting work on a pull request. This means you’ll be able to later switch back to working on another separate issue without interfering.
Run Tests
Always run the tests before submitting pull requests. Ideally run
tox to check compatibility across all supported versions.Managing Compatibility Issues
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.
Documentation
The documentation for REST framework is built from the Markdown source files in the docs directory. There are many great Markdown editors that make working with the documentation really easy. The Mou editor for Mac is one such editor that comes highly recommended.Building the Documentation
To build the documentation, install MkDocs:site directory.
You can build and preview in a browser:
Language Style
Documentation 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.Writing Tips
Writing Tips
- Keep paragraphs reasonably short
- Don’t use abbreviations like “e.g.” - use “For example” instead
- Use simple, clear language
- Maintain an objective tone
Markdown Style
There are a couple of conventions you should follow when working on the documentation.Headers
Headers should use the hash style:Links
Links should always use the reference style, with referenced hyperlinks kept at the end of the document:Notes
If you want to draw attention to a note or warning, use an admonition:info, warning, tip and danger admonition types.