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

Solution: Import the 'renderers' module

# Add the following line to the top of your code
from rest_framework import renderers

 

For more information:
rest_framework renderers