feat [api]: camelCase JSON parser and renderer

This commit is contained in:
Alice 2022-04-03 01:20:54 +02:00
parent 4ab121bea8
commit d95cd1f612
2 changed files with 14 additions and 0 deletions

View file

@ -1,3 +1,4 @@
Django==4.0.3
djangorestframework==3.13.1
django-cors-headers==3.11.0
djangorestframework-camel-case==1.3.0

View file

@ -125,3 +125,16 @@ STATIC_URL = "/static/"
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
REST_FRAMEWORK = {
"DEFAULT_RENDERER_CLASSES": (
"djangorestframework_camel_case.render.CamelCaseJSONRenderer",
"djangorestframework_camel_case.render.CamelCaseBrowsableAPIRenderer",
),
"DEFAULT_PARSER_CLASSES": (
"djangorestframework_camel_case.parser.CamelCaseFormParser",
"djangorestframework_camel_case.parser.CamelCaseMultiPartParser",
"djangorestframework_camel_case.parser.CamelCaseJSONParser",
),
}