We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
You have to be quite more concrete, and define "TokenAuthentication", to get any kind of helpful answer.
Sorry, something went wrong.
This is how i've been doing it against my services that are using django-rest-framework
import slumber class CUSTOMAPI(slumber.API): def __init__(self, *args, **kwargs): token = kwargs.pop('token', None) super(CUSTOMAPI, self).__init__(*args, **kwargs) if token is None: data = dict(zip(["username", "password"], self._store["session"].auth)) token = self.token.post(data=data)["token"] self._store['session'].auth = None self._store['session'].headers['Authorization'] = "Token " + token def _get_resource(self, **kwargs): return self.resource_class(**kwargs)
Would be nice if this was somehow built-in to slumber since its the recommended tool of choice for using it against django-rest-framework
any traction on this, seems like a no-brainer to put the token in the auth header for DRF.
@rocktavious's code definitely works though, was able to move forward with that workaround.
samgiles
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: