Forums

[Flask]LoginManager error

Hi,

I've been trying to use the Flask-LoginManager and used same implementation provided in Flask-LoginManager but encountered problem when I deploy it here.

@login_manager.user_loader()
def load_user(user_id):
    return User.query.filter(User.id == int(user_id)).first()

Error: 2016-08-24 15:15:17,989 :Error running WSGI application Traceback (most recent call last): File "/bin/user_wsgi_wrapper.py", line 154, in call app_iterator = self.app(environ, start_response) File "/bin/user_wsgi_wrapper.py", line 170, in import_error_application raise e TypeError: user_loader() takes exactly 2 arguments (1 given)

Any help are greatly appreciated.

Thanks.

Nevermind, I found the problem, forgot to remove the () in the @login_manager.user_loader

Cool. Glad you figured it out.