Enable token auth class
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user