Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Override default dictionary for settings REST_FRAMEWORK#1212

Answeredbysliverc
tobiasgardner asked this question inQ&A
Discussion options

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?

You must be logged in to vote

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 therespective attribute. You could create your own JSON:API specific view and derive all classes from that view.

Replies: 1 comment

Comment options

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 therespective attribute. You could create your own JSON:API specific view and derive all classes from that view.

You must be logged in to vote
0 replies
Answer selected bytobiasgardner
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@tobiasgardner@sliverc

[8]ページ先頭

©2009-2025 Movatter.jp