django-rest-framework Getting started with django-rest-framework Install or Setup


Example

Requirements

  • Python (2.7, 3.2, 3.3, 3.4, 3.5, 3.6)
  • Django (1.7+, 1.8, 1.9, 1.10, 1.11)

Install

You can either use pip to install or clone the project from github.

  • Using pip:

    pip install djangorestframework
    
  • Using git clone:

    git clone git@github.com:tomchristie/django-rest-framework.git
    

After installing, you need to add rest_framework to your INSTALLED_APPS settings.

INSTALLED_APPS = (
    ...
    'rest_framework',
)

If you're intending to use the browsable API you'll probably also want to add REST framework's login and logout views. Add the following to your root urls.py file.

urlpatterns = [
    ...
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
]