8👍
✅
Looks like you’re sending a request using XML content.
As the docs note, the obtain_auth_token view expect a JSON request.
Make sure the data is JSON encoded, and that you’re correctly setting the ‘Content-Type’ header to 'application/json
.
1👍
It’s because django-rest-framework can return data in more than one format. It apparently decides on which format by looking at the “Accept:” HTTP header in the request. Try changing the value of this header to something like “application/json” for example.
- Polymorphic Model Inheritance in Django
- Django, Cannot assign None, does not allow null values
- How to tell if your select query is within a transaction or not?
Source:stackexchange.com