Skip to content

Commit

Permalink
feat: django rest framework json:api works now
Browse files Browse the repository at this point in the history
  • Loading branch information
c0rydoras committed Oct 23, 2023
1 parent 5f97ca6 commit ca58210
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
22 changes: 22 additions & 0 deletions backend/outdated/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,28 @@

USE_TZ = True

REST_FRAMEWORK = {
"EXCEPTION_HANDLER": "rest_framework_json_api.exceptions.exception_handler",
"DEFAULT_PAGINATION_CLASS": "rest_framework_json_api.pagination.JsonApiPageNumberPagination",
"DEFAULT_PARSER_CLASSES": (
"rest_framework_json_api.parsers.JSONParser",
"rest_framework.parsers.FormParser",
"rest_framework.parsers.MultiPartParser",
),
"DEFAULT_RENDERER_CLASSES": (
"rest_framework_json_api.renderers.JSONRenderer",
# If you're performance testing, you will want to use the browseable API
# without forms, as the forms can generate their own queries.
# If performance testing, enable:
# Otherwise, to play around with the browseable API, enable:
# "rest_framework.renderers.BrowsableAPIRenderer",
),
"TEST_REQUEST_RENDERER_CLASSES": (
"rest_framework_json_api.renderers.JSONRenderer",
),
"TEST_REQUEST_DEFAULT_FORMAT": "vnd.api+json",
}


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.2/howto/static-files/
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ services:
ports:
- "${DATABASE_PORT}:${DATABASE_PORT}"
volumes:
- dbdata:/var/lib/postgresql/data
- psqldata:/var/lib/postgresql/data
volumes:
dbdata:

0 comments on commit ca58210

Please sign in to comment.