Open vasekch opened 4 years ago
Just a note.
According to requests
docs it should follow 301 redirect automatically for GET, OPTIONS, POST, PUT, PATCH or DELETE. Only where you need to explicitly enable it is HEAD.
But I'm not sure how exactly we use requests and if we should change something under ApiVerbShortcutMixin
in https://github.com/Yupeek/django-rest-models/blob/3750a4b7b9bfc8c5b290f5fe4703de1ae3331cf5/rest_models/backend/connexion.py#L120
I've successfully connected two django apps using django-rest-models 1.9.2, but I was facing following issue
When I've left everything in default as per tutorials (rest_framework and dynamic_rest on API server side and rest_models on client side) I was unable to run client application due to error:
It's because request is lacking the trailing slash. So API server responds with 301 redirect, but rest_models fail, because it's not 200 - https://github.com/Yupeek/django-rest-models/blob/3750a4b7b9bfc8c5b290f5fe4703de1ae3331cf5/rest_models/checks.py#L33. Is it possible to follow redirects somehow?
To bypass this I've changed my API - passed extra parameter to router constructor in
urls.py
(bellow). But I'd prefer original behavior.Thanks!