How to Solve NameError: name 'authentication' is not defined -- rest_framework

Solution: Import the 'authentication' module

To Solve the error, add the following line to the top of your code.

from rest_framework import authentication

 

For more information:
Python rest_framework authentication