Only enable browsable API if in debug mode (#3221)

(cherry picked from commit 6556cbd163)
This commit is contained in:
Oliver 2022-06-18 16:42:50 +10:00 committed by GitHub
parent 36868ebb4c
commit 9ba3fdf23d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -391,9 +391,16 @@ REST_FRAMEWORK = {
'InvenTree.permissions.RolePermission',
),
'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.coreapi.AutoSchema',
'DEFAULT_METADATA_CLASS': 'InvenTree.metadata.InvenTreeMetadata'
'DEFAULT_METADATA_CLASS': 'InvenTree.metadata.InvenTreeMetadata',
'DEFAULT_RENDERER_CLASSES': [
'rest_framework.renderers.JSONRenderer',
]
}
if DEBUG:
# Enable browsable API if in DEBUG mode
REST_FRAMEWORK['DEFAULT_RENDERER_CLASSES'].append('rest_framework.renderers.BrowsableAPIRenderer')
WSGI_APPLICATION = 'InvenTree.wsgi.application'
"""