How to Solve NameError: name 'generate_avatar' is not defined -- users
Solution: Import the 'generate_avatar' module
To Solve the error, add the following line to the top of your code.
from users.models import generate_avatar
For more information:
Python users generate_avatar