<h2id="about-third-party-packages"><aclass="toclink"href="#about-third-party-packages">About Third Party Packages</a></h2>
<p>Third Party Packages allow developers to share code that extends the functionality of Django REST framework, in order to support additional use-cases.</p>
<p>We <strong>support</strong>, <strong>encourage</strong> and <strong>strongly favor</strong> the creation of Third Party Packages to encapsulate new behavior rather than adding additional functionality directly to Django REST Framework.</p>
<p>We aim to make creating third party packages as easy as possible, whilst keeping a <strong>simple</strong> and <strong>well maintained</strong> core API. By promoting third party packages we ensure that the responsibility for a package remains with its author. If a package proves suitably popular it can always be considered for inclusion into the core REST framework.</p>
<p>If you have an idea for a new feature please consider how it may be packaged as a Third Party Package. We're always happy to discuss ideas on the <ahref="https://groups.google.com/forum/#!forum/django-rest-framework">Mailing List</a>.</p>
<h2id="how-to-create-a-third-party-package"><aclass="toclink"href="#how-to-create-a-third-party-package">How to create a Third Party Package</a></h2>
<h3id="creating-your-package"><aclass="toclink"href="#creating-your-package">Creating your package</a></h3>
<p>You can use <ahref="https://github.com/jpadilla/cookiecutter-django-rest-framework">this cookiecutter template</a> for creating reusable Django REST Framework packages quickly. Cookiecutter creates projects from project templates. While optional, this cookiecutter template includes best practices from Django REST framework and other packages, as well as a Travis CI configuration, Tox configuration, and a sane setup.py for easy PyPI registration/distribution.</p>
<p>Note: Let us know if you have an alternate cookiecuter package so we can also link to it.</p>
<h4id="running-the-initial-cookiecutter-command"><aclass="toclink"href="#running-the-initial-cookiecutter-command">Running the initial cookiecutter command</a></h4>
<p>To run the initial cookiecutter command, you'll first need to install the Python <code>cookiecutter</code> package.</p>
<pre><code>$ pip install cookiecutter
</code></pre>
<p>Once <code>cookiecutter</code> is installed just run the following to create a new project.</p>
<p>You'll be prompted for some questions, answer them, then it'll create your Python package in the current working directory based on those values.</p>
<pre><code>full_name (default is "Your full name here")? Johnny Appleseed
email (default is "you@example.com")? jappleseed@example.com
github_username (default is "yourname")? jappleseed
pypi_project_name (default is "dj-package")? djangorestframework-custom-auth
repo_name (default is "dj-package")? django-rest-framework-custom-auth
app_name (default is "djpackage")? custom_auth
project_short_description (default is "Your project description goes here")?
year (default is "2014")?
version (default is "0.1.0")?
</code></pre>
<h4id="getting-it-onto-github"><aclass="toclink"href="#getting-it-onto-github">Getting it onto GitHub</a></h4>
<p>To put your project up on GitHub, you'll need a repository for it to live in. You can create a new repository <ahref="https://github.com/new">here</a>. If you need help, check out the <ahref="https://help.github.com/articles/create-a-repo/">Create A Repo</a> article on GitHub.</p>
<h4id="adding-to-travis-ci"><aclass="toclink"href="#adding-to-travis-ci">Adding to Travis CI</a></h4>
<p>We recommend using <ahref="https://travis-ci.org">Travis CI</a>, a hosted continuous integration service which integrates well with GitHub and is free for public repositories.</p>
<p>To get started with Travis CI, <ahref="https://travis-ci.org">sign in</a> with your GitHub account. Once you're signed in, go to your <ahref="https://travis-ci.org/profile">profile page</a> and enable the service hook for the repository you want.</p>
<p>If you use the cookiecutter template, your project will already contain a <code>.travis.yml</code> file which Travis CI will use to build your project and run tests. By default, builds are triggered everytime you push to your repository or create Pull Request.</p>
<h4id="uploading-to-pypi"><aclass="toclink"href="#uploading-to-pypi">Uploading to PyPI</a></h4>
<p>Once you've got at least a prototype working and tests running, you should publish it on PyPI to allow others to install it via <code>pip</code>.</p>
<p>You must <ahref="https://pypi.python.org/pypi?%3Aaction=register_form">register</a> an account before publishing to PyPI.</p>
<p>To register your package on PyPI run the following command.</p>
<pre><code>$ python setup.py register
</code></pre>
<p>If this is the first time publishing to PyPI, you'll be prompted to login.</p>
<p>Note: Before publishing you'll need to make sure you have the latest pip that supports <code>wheel</code> as well as install the <code>wheel</code> package.</p>
<pre><code>$ pip install --upgrade pip
$ pip install wheel
</code></pre>
<p>After this, every time you want to release a new version on PyPI just run the following command.</p>
<pre><code>$ python setup.py publish
You probably want to also tag the version now:
git tag -a {0} -m 'version 0.1.0'
git push --tags
</code></pre>
<p>After releasing a new version to PyPI, it's always a good idea to tag the version and make available as a GitHub Release.</p>
<p>We recommend to follow <ahref="http://semver.org/">Semantic Versioning</a> for your package's versions.</p>
<p>The cookiecutter template assumes a set of supported versions will be provided for Python and Django. Make sure you correctly update your requirements, docs, <code>tox.ini</code>, <code>.travis.yml</code>, and <code>setup.py</code> to match the set of versions you wish to support.</p>
<p>Shorter form to run the tests for a given test method.</p>
<pre><code>$ ./runtests.py test_this_method
</code></pre>
<p>To run your tests against multiple versions of Python as different versions of requirements such as Django we recommend using <code>tox</code>. <ahref="https://tox.readthedocs.io/en/latest/">Tox</a> is a generic virtualenv management and test command line tool.</p>
<p>First, install <code>tox</code> globally.</p>
<pre><code>$ pip install tox
</code></pre>
<p>To run <code>tox</code>, just simply run:</p>
<pre><code>$ tox
</code></pre>
<p>To run a particular <code>tox</code> environment:</p>
<pre><code>$ tox -e envlist
</code></pre>
<p><code>envlist</code> is a comma-separated value to that specifies the environments to run tests against. To view a list of all possible test environments, run:</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 a <code>compat.py</code> module, and should provide a single common interface that the rest of the codebase can use.</p>
<p>Check out Django REST framework's <ahref="https://github.com/encode/django-rest-framework/blob/master/rest_framework/compat.py">compat.py</a> for an example.</p>
<h3id="once-your-package-is-available"><aclass="toclink"href="#once-your-package-is-available">Once your package is available</a></h3>
<p>Once your package is decently documented and available on PyPI, you might want share it with others that might find it useful.</p>
<h4id="adding-to-the-django-rest-framework-grid"><aclass="toclink"href="#adding-to-the-django-rest-framework-grid">Adding to the Django REST framework grid</a></h4>
<p>We suggest adding your package to the <ahref="https://www.djangopackages.com/grids/g/django-rest-framework/">REST Framework</a> grid on Django Packages.</p>
<h4id="adding-to-the-django-rest-framework-docs"><aclass="toclink"href="#adding-to-the-django-rest-framework-docs">Adding to the Django REST framework docs</a></h4>
<p>Create a <ahref="https://github.com/encode/django-rest-framework/compare">Pull Request</a> or <ahref="https://github.com/encode/django-rest-framework/issues/new">Issue</a> on GitHub, and we'll add a link to it from the main REST framework documentation. You can add your package under <strong>Third party packages</strong> of the API Guide section that best applies, like <ahref="../../api-guide/authentication/">Authentication</a> or <ahref="../../api-guide/permissions/">Permissions</a>. You can also link your package under the <ahref="../../topics/third-party-packages/#existing-third-party-packages">Third Party Packages</a> section.</p>
<h4id="announce-on-the-discussion-group"><aclass="toclink"href="#announce-on-the-discussion-group">Announce on the discussion group.</a></h4>
<p>You can also let others know about your package through the <ahref="https://groups.google.com/forum/#!forum/django-rest-framework">discussion group</a>.</p>
<h2id="existing-third-party-packages"><aclass="toclink"href="#existing-third-party-packages">Existing Third Party Packages</a></h2>
<p>Django REST Framework has a growing community of developers, packages, and resources.</p>
<p>Check out a grid detailing all the packages and ecosystem around Django REST Framework at <ahref="https://www.djangopackages.com/grids/g/django-rest-framework/">Django Packages</a>.</p>
<p>To submit new content, <ahref="https://github.com/encode/django-rest-framework/issues/new">open an issue</a> or <ahref="https://github.com/encode/django-rest-framework/compare">create a pull request</a>.</p>
<li><ahref="https://github.com/davesque/django-rest-framework-simplejwt">djangorestframework-simplejwt</a> - An alternative package that provides JSON Web Token Authentication support.</li>
<li><ahref="https://github.com/etoccalino/django-rest-framework-httpsignature">djangorestframework-httpsignature</a> - Provides an easy to use HTTP Signature Authentication mechanism.</li>
<li><ahref="https://github.com/sunscrapers/djoser">djoser</a> - Provides a set of views to handle basic actions such as registration, login, logout, password reset and account activation.</li>
<li><ahref="https://github.com/Tivix/django-rest-auth/">django-rest-auth</a> - Provides a set of REST API endpoints for registration, authentication (including social media authentication), password reset, retrieve and update user details, etc.</li>
<li><ahref="https://github.com/ByteInternet/drf-oidc-auth">drf-oidc-auth</a> - Implements OpenID Connect token authentication for DRF.</li>
<li><ahref="https://github.com/aaronn/django-rest-framework-passwordless">drfpasswordless</a> - Adds (Medium, Square Cash inspired) passwordless logins and signups via email and mobile numbers.</li>
<li><ahref="https://github.com/kevin-brown/drf-any-permissions">drf-any-permissions</a> - Provides alternative permission handling.</li>
<li><ahref="https://github.com/niwibe/djangorestframework-composed-permissions">djangorestframework-composed-permissions</a> - Provides a simple way to define complex permissions.</li>
<li><ahref="https://github.com/caxap/rest_condition">rest_condition</a> - Another extension for building complex permissions in a simple and convenient way.</li>
<li><ahref="https://github.com/Helioscene/dry-rest-permissions">dry-rest-permissions</a> - Provides a simple way to define permissions for individual api actions.</li>
<li><ahref="https://github.com/umutbozkurt/django-rest-framework-mongoengine">django-rest-framework-mongoengine</a> - Serializer class that supports using MongoDB as the storage layer for Django REST framework.</li>
<li><ahref="https://github.com/djangonauts/django-rest-framework-hstore">djangorestframework-hstore</a> - Serializer class to support django-hstore DictionaryField model field and its schema-mode feature.</li>
<li><ahref="https://github.com/django-json-api/django-rest-framework-json-api">djangorestframework-jsonapi</a> - Provides a parser, renderer, serializers, and other tools to help build an API that is compliant with the jsonapi.org spec.</li>
<li><ahref="https://github.com/wq/html-json-forms">html-json-forms</a> - Provides an algorithm and serializer to process HTML JSON Form submissions per the (inactive) spec.</li>
Enables black/whitelisting fields, and conditionally expanding child serializers on a per-view/request basis.</li>
<li><ahref="https://github.com/wimglenn/djangorestframework-queryfields">djangorestframework-queryfields</a> - Serializer mixin allowing clients to control which fields will be sent in the API response.</li>
<li><ahref="https://github.com/estebistec/drf-compound-fields">drf-compound-fields</a> - Provides "compound" serializer fields, such as lists of simple values.</li>
<li><ahref="https://github.com/Hipo/drf-extra-fields">django-extra-fields</a> - Provides extra serializer fields.</li>
<li><ahref="https://github.com/WGBH/django-versatileimagefield">django-versatileimagefield</a> - Provides a drop-in replacement for Django's stock <code>ImageField</code> that makes it easy to serve images in multiple sizes/renditions from a single field. For DRF-specific implementation docs, <ahref="https://django-versatileimagefield.readthedocs.io/en/latest/drf_integration.html">click here</a>.</li>
<li><ahref="https://github.com/miki725/django-rest-framework-bulk">djangorestframework-bulk</a> - Implements generic view mixins as well as some common concrete generic views to allow to apply bulk operations via API requests.</li>
<li><ahref="https://github.com/MattBroach/DjangoRestMultipleModels">django-rest-multiple-models</a> - Provides a generic view (and mixin) for sending multiple serialized models and/or querysets via a single API request.</li>
<li><ahref="https://github.com/alanjds/drf-nested-routers">drf-nested-routers</a> - Provides routers and relationship fields for working with nested resources.</li>
<li><ahref="http://wq.io/docs/about-rest">wq.db.rest</a> - Provides an admin-style model registration API with reasonable default URLs and viewsets.</li>
<li><ahref="https://github.com/juanriaza/django-rest-framework-msgpack">djangorestframework-msgpack</a> - Provides MessagePack renderer and parser support.</li>
<li><ahref="https://github.com/django-json-api/django-rest-framework-json-api">djangorestframework-jsonapi</a> - Provides a parser, renderer, serializers, and other tools to help build an API that is compliant with the jsonapi.org spec.</li>
<li><ahref="https://github.com/vbabiy/djangorestframework-camel-case">djangorestframework-camel-case</a> - Provides camel case JSON renderers and parsers.</li>
<li><ahref="https://github.com/django-json-api/django-rest-framework-json-api">djangorestframework-jsonapi</a> - Provides a parser, renderer, serializers, and other tools to help build an API that is compliant with the jsonapi.org spec.</li>
<li><ahref="https://github.com/gizmag/drf-ujson-renderer">drf_ujson</a> - Implements JSON rendering using the UJSON package.</li>
<li><ahref="https://github.com/wq/django-rest-pandas">rest-pandas</a> - Pandas DataFrame-powered renderers including Excel, CSV, and SVG formats.</li>
<li><ahref="https://github.com/philipn/django-rest-framework-chain">djangorestframework-chain</a> - Allows arbitrary chaining of both relations and lookup filters.</li>
<li><ahref="https://github.com/miki725/django-url-filter">django-url-filter</a> - Allows a safe way to filter data via human-friendly URLs. It is a generic library which is not tied to DRF but it provides easy integration with DRF.</li>
<li><ahref="https://github.com/manjitkumar/drf-url-filters">drf-url-filter</a> is a simple Django app to apply filters on drf <code>ModelViewSet</code>'s <code>Queryset</code> in a clean, simple and configurable way. It also supports validations on incoming query params and their values.</li>
<li><ahref="https://github.com/agconti/cookiecutter-django-rest">cookiecutter-django-rest</a> - A cookiecutter template that takes care of the setup and configuration so you can focus on making your REST apis awesome.</li>
<li><ahref="https://github.com/fredkingham/django_rest_model_hyperlink_serializers_project">djangorestrelationalhyperlink</a> - A hyperlinked serialiser that can can be used to alter relationships via hyperlinks, but otherwise like a hyperlink model serializer.</li>
<li><ahref="https://github.com/marcgibbons/django-rest-swagger">django-rest-swagger</a> - An API documentation generator for Swagger UI.</li>
<li><ahref="https://github.com/eofs/django-rest-framework-proxy">django-rest-framework-proxy</a> - Proxy to redirect incoming request to another API server.</li>
<li><ahref="https://github.com/AppsFuel/gaiarestframework">gaiarestframework</a> - Utils for django-rest-framework</li>
<li><ahref="https://github.com/chibisov/drf-extensions">drf-extensions</a> - A collection of custom extensions</li>
<li><ahref="https://github.com/dustinfarris/ember-django-adapter">ember-django-adapter</a> - An adapter for working with Ember.js</li>
<li><ahref="https://github.com/WGBH/django-versatileimagefield">django-versatileimagefield</a> - Provides a drop-in replacement for Django's stock <code>ImageField</code> that makes it easy to serve images in multiple sizes/renditions from a single field. For DRF-specific implementation docs, <ahref="https://django-versatileimagefield.readthedocs.io/en/latest/drf_integration.html">click here</a>.</li>
<li><ahref="https://github.com/aschn/drf-tracking">drf-tracking</a> - Utilities to track requests to DRF API views.</li>
<li><ahref="https://github.com/ArabellaTech/drf_tweaks">drf_tweaks</a> - Serializers with one-step validation (and more), pagination without counts and other tweaks.</li>
<li><ahref="https://github.com/dealertrack/django-rest-framework-braces">django-rest-framework-braces</a> - Collection of utilities for working with Django Rest Framework. The most notable ones are <ahref="https://django-rest-framework-braces.readthedocs.io/en/latest/overview.html#formserializer">FormSerializer</a> and <ahref="https://django-rest-framework-braces.readthedocs.io/en/latest/overview.html#serializerform">SerializerForm</a>, which are adapters between DRF serializers and Django forms.</li>
<li><ahref="https://drf-haystack.readthedocs.io/en/latest/">drf-haystack</a> - Haystack search for Django Rest Framework</li>
<li><ahref="https://github.com/mrhwick/django-rest-framework-version-transforms">django-rest-framework-version-transforms</a> - Enables the use of delta transformations for versioning of DRF resource representations.</li>
<li><ahref="https://github.com/raphaelgyory/django-rest-messaging">django-rest-messaging</a>, <ahref="https://github.com/raphaelgyory/django-rest-messaging-centrifugo">django-rest-messaging-centrifugo</a> and <ahref="https://github.com/raphaelgyory/django-rest-messaging-js">django-rest-messaging-js</a> - A real-time pluggable messaging service using DRM.</li>