title: Missing userloader or request_loader error
body: <p>i have an isssue with flask-login the user loader is not working </p>
  
  <hr>
  
  <pre><code>Exception: Missing user_loader or request_loader. Refer to http://flask-login.readthedocs.io/#how-it-works for more info.
  </code></pre>
  
  <p>and
  when i try to import the user model in shell:</p>
  
  <pre><code>AttributeError: 'LoginManager' object has no attribute 'load_user'
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>-------------------app/__init__.py----------------
  
  from app.config import Config
  from flask import Flask
  from flask_sqlalchemy import SQLAlchemy
  from flask_login import LoginManager
  
  
  #create app
  app = Flask(__name__)
  app.config.from_object(Config)
  
  #init pckages
  db = SQLAlchemy(app)
  login_manager = LoginManager(app)
  
  #import Blueprints
  from app.blueprints.user.routes import user
  from app.blueprints.dashboard.routes import dashboard
  
  #register Blueprints
  app.register_blueprint(user)
  app.register_blueprint(dashboard)
  
  ------------------------------app.py-------------------------------
  from app import app
  
  if __name__ == "__main__":
  
      app.run(debug=True)
  ------------------------------user model------------------------------------
  from app import db, login_manager
  from flask_login import UserMixin
  
  
  @login_manager.load_user
  def load_user(user):
      return User.get(user)
  
  
  class User(db.Model, UserMixin):
      id = db.Column(db.Integer, primary_key=True)
      username = db.Column(db.String(20), unique=True, nullable=False)
      email = db.Column(db.String(20), unique=True, nullable=False)
      avatar = db.Column(db.String(50), default="default.jpg")
      password = db.Column(db.String(60), nullable=False)
  
  
      def __repr__(self):
          return self.username
  </code></pre>