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

Solution: Import the 'action' module

# Add the following line to the top of your code
from rest_framework.decorators import action

 

For more information:
rest_framework action