Django REST Frameworkのインストールと設定


設定

# [Bash]
pip install djangorestframework

設定

# /mysite/settings.py

# Application definition
INSTALLED_APPS = [
    # ...
    'rest_framework',
    # ...
]

# REST Framework
REST_FRAMEWORK = {
    'DEFAULT_PERMISSION_CLASSES': [
        'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
    ]
}