How to Solve NameError: name 'DetailView' is not defined -- django

Erorr: name 'DetailView' is not defined

NameError: name 'DetailView' is not defined

Solution: name 'DetailView' is not defined

# Add the following line to the top of your code
from django.views.generic import DetailView

 

For more information:
Django DetailView