Django REST Framework: using TokenAuthentication with browsable API

前端 未结 3 1188
我在风中等你
我在风中等你 2020-12-29 23:08

I\'m following the DRF docs to setup TokenAuthentication, and can\'t get it working with the browsable API. I believe I\'ve added the proper lines in settings.py

3条回答
  •  庸人自扰
    2020-12-29 23:43

    You can use a browser plugin to set token in the header. I'm using Modheader which is free.

    The example of setting the header:

    I wrote a blog post on how this can be done: link to post.

    I like this solution because you don't need to change the auth classes.

提交回复
热议问题