I\'m using postman to check json response from my django-rest-framework.
When my first try to post id, email, password through POST method to my django on AWS(amazon web
In settings.py file
INSTALLED_APPS = [
...
...
...
...
'rest_framework.authtoken',
...
]
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.TokenAuthentication',
),
}
in project urls.py
from rest_framework.authtoken import views
urlpatterns = [
....
path('api-token-auth/',views.obtain_auth_token,name='api-token-auth')
]
Open terminal as
$ pip3 install httpie
$ python3 manage.py createsuperuser # if not created
$ http POST http://localhost:8000/api-token-auth/ username="username" password = "password" # You will get token key (Just copy it) ex:a243re43fdeg7r4rfgedwe89320
You token key will be also automatically saved in your databases
Go to postman header (like in example) Ex: screenshot from postman ,where and how to paste accessed toke Then insert you token key.
reference to get token key from this video