How to Solve NameError: name 'current_user' is not defined -- flask_login

Solution: Import the 'current_user' module

To Solve the error, add the following line to the top of your code.

from flask_login import current_user

 

For more information:
Python flask_login current_user