Enable browsable API login
This commit is contained in:
@@ -47,6 +47,7 @@ INSTALLED_APPS = [
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'rest_framework',
|
||||
'rest_framework.authtoken',
|
||||
'apiserver.api',
|
||||
]
|
||||
|
||||
@@ -139,10 +140,20 @@ if DEBUG:
|
||||
'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': 20,
|
||||
'DEFAULT_RENDERER_CLASSES': DEFAULT_RENDERER_CLASSES,
|
||||
'DEFAULT_AUTHENTICATION_CLASSES': DEFAULT_AUTHENTICATION_CLASSES,
|
||||
}
|
||||
|
||||
LOGGING = {
|
||||
|
||||
Reference in New Issue
Block a user