q

Size: a a a
q
L
mysqldump --compatible=postgresql
L
KU
S
q
DT
REST_FRAMEWORK = {?
...
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.TokenAuthentication',
'rest_framework.authentication.BasicAuthentication'
)
}
DT
KU
REST_FRAMEWORK = {?
...
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.TokenAuthentication',
'rest_framework.authentication.BasicAuthentication'
)
}
REST_FRAMEWORK = {'DEFAULT_SCHEMA_CLASS': ('rest_framework.schemas.coreapi.AutoSchema'),
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.TokenAuthentication',
),
'DEFAULT_PARSER_CLASSES': (
'rest_framework.parsers.FormParser',
'rest_framework.parsers.MultiPartParser',
'rest_framework.parsers.JSONParser',
),
'EXCEPTION_HANDLER':
'api.except_handler.custom_exception_handler',
}
DT
REST_FRAMEWORK = {'DEFAULT_SCHEMA_CLASS': ('rest_framework.schemas.coreapi.AutoSchema'),
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.TokenAuthentication',
),
'DEFAULT_PARSER_CLASSES': (
'rest_framework.parsers.FormParser',
'rest_framework.parsers.MultiPartParser',
'rest_framework.parsers.JSONParser',
),
'EXCEPTION_HANDLER':
'api.except_handler.custom_exception_handler',
}
SWAGGER_SETTINGS
?DT
SWAGGER_SETTINGS = {
'SECURITY_DEFINITIONS': {
'api_key': {
'type': 'apiKey',
'in': 'header',
'name': 'Authorization'
}
},
}
KU
SWAGGER_SETTINGS
?SWAGGER_SETTINGS = {
"DEFAULT_GENERATOR_CLASS": "rest_framework.schemas.generators.BaseSchemaGenerator",
'VALIDATOR_URL': 'http://localhost:8189',
"SHOW_REQUEST_HEADERS": True,
'SECURITY_DEFINITIONS': {
'api_key': {
'type': 'apiKey',
'in': 'header',
'name': 'Authorization'
}
},
}
DT
DT
KU
response=400
{
"message": "non_field_errors: Unable to log in with provided credentials.\n",
"code": "validation_error"
}
DT
KU
http://127.0.0.1:8000/api/user/api-token-auth/
KU
curl -X POST "http://127.0.0.1:8000/api/user/api-token-auth/" -H "accept: application/json" -H "Content-Type: application/json" -H "X-CSRFToken: Qp22w1YbvgUqxxYCcT1RbZqDps1emlFd5Pt2Lab7LWMjH6Zbm3o4VV49PmpXpOFU" -d "{ \"username\": \"string\", \"password\": \"string\"}"
KU
ЯК