Using an alternative dict for settings (not REST_FRAMEWORK) #9351
-
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 (https://github.com/django-json-api/django-rest-framework-json-api) Both DRF and JSON:API module are using the dict REST_FRAMEWORK for settings. 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. Is it possible to rename our existing REST_FRAMEWORK dict to e.g. REST_FRAMEWORK_v1 and if so, how do we get DRF to use that? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
We don't support that, no. Perhaps one approach would be running the different APIs as different processes with (Just an idea, good luck with it) |
Beta Was this translation helpful? Give feedback.
We don't support that, no. Perhaps one approach would be running the different APIs as different processes with
runserver
pointed at a different Django settings module in each case? You'd also need to configure the frontend server (gunicorn or whatever) to route to each of the processes, doing that by hostnamev2.myapi.com
might be the reasonable approach.(Just an idea, good luck with it)