<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>Other really great ways you can help move the community forward include helping answer questions on the <ahref="https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework">discussion group</a>, or setting up an <ahref="http://stackexchange.com/filters/66475/rest-framework">email alert on StackOverflow</a> so that you get notified of any new questions with the <code>django-rest-framework</code> tag.</p>
<p>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. </p>
<p>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.</p>
<p>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.</p>
<p>The <ahref="https://www.djangoproject.com/conduct/">Django code of conduct</a> gives a fuller set of guidelines for participating in community forums.</p>
<p>It's really helpful if you can make sure to address issues on the correct channel. Usage questions should be directed to the <ahref="https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework">discussion group</a>. Feature requests, bug reports and other issues should be raised on the GitHub <ahref="https://github.com/tomchristie/django-rest-framework/issues?state=open">issue tracker</a>.</p>
<li>When describing issues try to phrase your ticket in terms of the <em>behavior</em> you think needs changing rather than the <em>code</em> you think need changing.</li>
<li>Search the issue list first for related items, and make sure you're running the latest version of REST framework before reporting an issue.</li>
<li>If reporting a bug, then try to include a pull request with a failing test case. This will help us quickly identify if there is a valid issue, and make sure that it gets fixed more quickly if there is one.</li>
<li>Feature requests will often be closed with a recommendation that they be implemented outside of the core REST framework library. Keeping new feature requests implemented as third party libraries allows us to keep down the maintainence overhead of REST framework, so that the focus can be on continued stability, bugfixes, and great documentation.</li>
<li>Closing an issue doesn't necessarily mean the end of a discussion. If you believe your issue has been closed incorrectly, explain why and we'll consider if it needs to be reopened.</li>
<p>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 </p>
<li>Read through the ticket - does it make sense, is it missing any context that would help explain it better?</li>
<li>Is the ticket reported in the correct place, would it be better suited as a discussion on the discussion group?</li>
<li>If the ticket is a bug report, can you reproduce it? Are you able to write a failing test case that demonstrates the issue and that can be submitted as a pull request?</li>
<li>If the ticket is a feature request, do you agree with it, and could the feature request instead be implemented as a third party package?</li>
<li>If a ticket hasn't had much activity and it addresses something you need, then comment on the ticket and try to find out what's needed to get it moving again.</li>
<p>Changes should broadly follow the <ahref="http://www.python.org/dev/peps/pep-0008/">PEP 8</a> style conventions, and we recommend you setup your editor to automatically indicated non-conforming styles.</p>
<h2id="testing">Testing</h2>
<p>To run the tests, clone the repository, and then:</p>
<preclass="prettyprint lang-py"><code># Setup the virtual environment
<p>You can also use the excellent <code>[tox][tox]</code> testing tool to run the tests against all supported versions of Python and Django. Install <code>tox</code> globally, and then simply run:</p>
<preclass="prettyprint lang-py"><code>tox
</code></pre>
<h2id="pull-requests">Pull requests</h2>
<p>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.</p>
<p>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 seperate issue without interfering with an ongoing pull requests.</p>
<p>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.</p>
<p>GitHub's documentation for working on pull requests is <ahref="https://help.github.com/articles/using-pull-requests">available here</a>.</p>
<p>Always run the tests before submitting pull requests, and ideally run <code>tox</code> in order to check that your modifications are compatible with both Python 2 and Python 3, and that they run properly on all supported versions of Django.</p>
<p>Once you've made a pull request take a look at the travis build status in the GitHub interface and make sure the tests are runnning as you'd expect.</p>
<p>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 the <code>compat.py</code> module, and should provide a single common interface that the rest of the codebase can use.</p>
<p>The documentation for REST framework is built from the <ahref="http://daringfireball.net/projects/markdown/basics">Markdown</a> source files in <ahref="https://github.com/tomchristie/django-rest-framework/tree/master/docs">the docs directory</a>.</p>
<p>There are many great markdown editors that make working with the documentation really easy. The <ahref="http://mouapp.com/">Mou editor for Mac</a> is one such editor that comes highly recommended.</p>
<h2id="building-the-documentation">Building the documentation</h2>
<p>To build the documentation, simply run the <code>mkdocs.py</code> script.</p>
<preclass="prettyprint lang-py"><code>./mkdocs.py
</code></pre>
<p>This will build the html output into the <code>html</code> directory.</p>
<p>You can build the documentation and open a preview in a browser window by using the <code>-p</code> flag.</p>
<p>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.</p>
<p>Some other tips:</p>
<ul>
<li>Keep paragraphs reasonably short.</li>
<li>Use double spacing after the end of sentences.</li>
<p>There are a couple of conventions you should follow when working on the documentation.</p>
<h5id="1-headers">1. Headers</h5>
<p>Headers should use the hash style. For example:</p>
<preclass="prettyprint lang-py"><code>### Some important topic
</code></pre>
<p>The underline style should not be used. <strong>Don't do this:</strong></p>
<preclass="prettyprint lang-py"><code>Some important topic
====================
</code></pre>
<h5id="2-links">2. Links</h5>
<p>Links should always use the reference style, with the referenced hyperlinks kept at the end of the document.</p>
<preclass="prettyprint lang-py"><code>Here is a link to [some other thing][other-thing].
More text...
[other-thing]: http://example.com/other/thing
</code></pre>
<p>This style helps keep the documentation source consistent and readable.</p>
<p>If you are hyperlinking to another REST framework document, you should use a relative link, and link to the <code>.md</code> suffix. For example:</p>
<p>Linking 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.</p>
<h5id="3-notes">3. Notes</h5>
<p>If you want to draw attention to a note or warning, use a pair of enclosing lines, like so:</p>
<h1id="third-party-packages">Third party packages</h1>
<p>New features to REST framework are generally recommended to be implemented as third party libraries that are developed outside of the core framework. Ideally third party libraries should be properly documented and packaged, and made available on PyPI.</p>
<h2id="getting-started">Getting started</h2>
<p>If you have some functionality that you would like to implement as a third party package it's worth contacting the <ahref="https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework">discussion group</a> as others may be willing to get involved. We strongly encourage third party package development and will always try to prioritize time spent helping their development, documentation and packaging.</p>
<p>We recommend the <ahref="https://github.com/dabapps/django-reusable-app"><code>django-reusable-app</code></a> template as a good resource for getting up and running with implementing a third party Django package.</p>
<h2id="linking-to-your-package">Linking to your package</h2>
<p>Once your package is decently documented and available on PyPI open a pull request or issue, and we'll add a link to it from the main REST framework documentation.</p>