Enable token auth class

This commit is contained in:
Tanner Collin 2021-07-16 04:18:30 +00:00
parent 4e6b393b23
commit 8ff02f6149

View File

@ -143,4 +143,31 @@ USE_TZ = True
STATIC_URL = '/static/'
DEFAULT_RENDERER_CLASSES = (
'rest_framework.renderers.JSONRenderer',
)
if DEBUG:
DEFAULT_RENDERER_CLASSES += (
'rest_framework.renderers.BrowsableAPIRenderer',
)
DEFAULT_AUTHENTICATION_CLASSES = (
'rest_framework.authentication.TokenAuthentication',
)
if DEBUG:
DEFAULT_AUTHENTICATION_CLASSES += (
'rest_framework.authentication.SessionAuthentication',
)
REST_FRAMEWORK = {
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
'PAGE_SIZE': 300,
'DEFAULT_RENDERER_CLASSES': DEFAULT_RENDERER_CLASSES,
'DEFAULT_AUTHENTICATION_CLASSES': DEFAULT_AUTHENTICATION_CLASSES,
}
SITE_ID = 1