Skip to main content

A re-useable Django app for automatically building a REST API based on models.

Project description


TravisCI PyPI Coveralls Documentation Status Code Style




AutoREST is a reusable Django app for building REST APIs from model definitions and (optionally) definitions.

The Problem: Building APIs for models is boring.

The Solution: This app builds them for you, optionally using your AdminSite as a guide, and you can just focus on the custom stuff.

How to Use

$ pip install django-autorest

Include autorest in your INSTALLED_APPS.


  • AUTOREST_ADMIN_SITE (default ''): This is an import string to the admin site where autorest can get hints on how the API should be configured (e.g., list display fields, edit fields, readonly fields, etc). To disable this feature entirely, just set this to False.
  • AUTOREST_DEFAULT_USE_ADMIN_SITE (default False): Whether the default model functionality should be to get config hints from
  • AUTOREST_DEFAULT_ENABLE (default: True): Whether API ViewSets/URLs should be built for models which don’t have an explicit entry in the AUTOREST_CONFIG. If this option is False, then only models defined in the AUTOREST_CONFIG will have URLs generated for them.
  • AUTOREST_CONFIG default:
    'auth': {
        'User': {
            'viewset': 'autorest.sample_user_viewset.UserViewSet',


  • use_admin_site: Whether to use the admin site to build the API.
  • serializer: An import string to a serializer instance. (Note: if you would use multiple serializers for different actions like list/detail, then you can use drf-action-serializer) to configure a single serializer that supports per-action field configuration.)
  • viewset: An import string to a full viewset for this model.


Submit a pull request if you would like to contribute. You must only contribute code that you have authored or otherwise hold the copyright to, and you must make any contributions to this project available under the MIT license.


AutoREST comes with a file, allowing it to run as a standalone project.

$ git clone

Then you can go into the django-autorest directory and do the initial migrations and run the server (you may need to type python3 rather than python):

$ cd django-autorest
$ python migrate
$ python createsuperuser
$ python runserver

Then you can see the api at

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-autorest-1.0.1.tar.gz (11.1 kB view hashes)

Uploaded source

Built Distribution

django_autorest-1.0.1-py3-none-any.whl (12.2 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page