Exception: No user_loader has been installed for this LoginManager
See original GitHub issueFor apps with multiple User models, is there any way to alter the user_loader / load_user() to be able to distinguish between the models? The standard is
@login_manager.user_loader
def load_user(user_id):
return User.get(user_id)
I need to somehow discern which model the user_id passed belongs to and insert a condition to replace User.get() with the appropriate model.
Issue Analytics
- State:
- Created 7 years ago
- Comments:13
Top Results From Across the Web
flask-login:Exception: No user_loader has been installed for ...
I want to use flask_login to manager user login but some error like this: Exception: No user_loader has been ...
Read more >Flask: No user_loader has been installed for this LoginManager
Error: Exception: No user_loader has been installed for this LoginManager. Refer tohttps://flask-login.readthedocs.io/en/latest/#how-it ...
Read more >Flask-Login:Exception: No User_Loader Has Been Installed ...
This article will cover how to add authentication to your Flask app with the A user loader tells FlaskLogin how to find a...
Read more >Flask-Login — Flask-Login 0.7.0 documentation
Once the actual application object has been created, you can configure it for ... It should return None (not raise an exception) if...
Read more >Missing user_loader or request_loader Flask
No user loader has been installed. Exception: No user_loader has been installed for this LoginManager. Add one with the 'LoginManager.user_loader' decorator ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@davidism could you help release v0.4.2? Would you like me to submit a PR to update the changelog?
You must define the decorator at the same file you instantiated the login_manager. Assuming it’s on yourapp.py you shoud do like below:
After that you can delete the
@login_manager
decorator and its respect function from your models.Obs. This works on version 0.4.1 of Flask-Login