-
Notifications
You must be signed in to change notification settings - Fork 300
Override default dictionary for settings REST_FRAMEWORK #1212
-
Hi! We already have an API in place based on "plain" DRF. But now we want to introduce a v2 of the API, based on the JSON:API module.
In order for our v1 API to continue working as is for the moment, we need to keep the existing settings in the REST_FRAMEWORK dictionary in settings.py and introduce a new dict for the JSON:API module, e.g. REST_FRAMEWORK_JSON_API.
How can we tell django-json-api to use another dict for settings than the default REST_FRAMEWORK?
Beta Was this translation helpful? Give feedback.
All reactions
DJA is only a thin layer over Django REST framework and fully depends on it, so it is therefore not possible to have two different setting dicts.
However, within Django REST framework you can overwrite the configuration in the view itself by setting the respective attribute. You could create your own JSON:API specific view and derive all classes from that view.
Replies: 1 comment
-
DJA is only a thin layer over Django REST framework and fully depends on it, so it is therefore not possible to have two different setting dicts.
However, within Django REST framework you can overwrite the configuration in the view itself by setting the respective attribute. You could create your own JSON:API specific view and derive all classes from that view.
Beta Was this translation helpful? Give feedback.