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

Erorr: name 'get_current_site' is not defined

NameError: name 'get_current_site' is not defined

Solution: Import the 'get_current_site' module

# Add the following line to the top of your code
from django.contrib.sites.shortcuts import get_current_site

 

For more information:
django get_current_site