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

Solution: Import the 'get_apps' module

# Add the following line to the top of your code
from django.db.models.loading import get_apps

 

For more information:
django get_apps