flask-login

Flask randomly returns user as not logged in when they are

Flask randomly returns user as not logged in when they are Question: I have a reasonably sized Flask project that works fine when run locally, however, when run via Apache or Nginx Server (locally hosted or externally hosted) users will occasionally be prompted that they are not logged in before getting redirected several times. Below …

Total answers: 1

Can flask_login still work if Flask is being used at server side (backend) only?

Can flask_login still work if Flask is being used at server side (backend) only? Question: I am working on a web app where Flask is used as backend and react as frontend. I was wondering if flask’s flask-login extension which handle login and logout of users, can be used in this scenario. Flask is purely …

Total answers: 1

How to create a User class for Flask-Login when using dynamodb?

How to create a User class for Flask-Login when using dynamodb? Question: I am following the tutorial at https://www.digitalocean.com/community/tutorials/how-to-add-authentication-to-your-app-with-flask-login for adding register/login features to a flask app, which uses Flask-Login with an SQLite database (using flask_sqlalchemy). As such, it has code like the following for initializing the SQLite database (from init.py): db = SQLAlchemy() def …

Total answers: 2

Customizing the flask admin row actions

Customizing the flask admin row actions Question: I want to add another button next to the edit and delete icons on flask admin list view. In addition, I want to send that row data to a route as a post request. I know that I have to edit the admin/model/list.html template, but I am not …

Total answers: 1

PyCharm warns about unexpected arguments for SQLAlchemy User model

PyCharm warns about unexpected arguments for SQLAlchemy User model Question: I’m working with Flask-SQLAlchemy in PyCharm. When I try to create instances of my User model by passing keyword arguments to the model, PyCharm highlights the arguments with an “Unexpected argument(s)” warning. When I create instances of other models, I don’t get this warning. Why …

Total answers: 4

Unable to import flask_login

Unable to import flask_login Question: I am following the book explore flask on explore flask site, I am getting this error, I just installed flask-login and import this as following pip install flask-login from flask_login import login_required I expect to save this normally without any errors, but VS CODE terminal show this error “Unable to …

Total answers: 2

How to combine Dash and Flask login without using iframe?

How to combine Dash and Flask login without using iframe? Question: I have a flask application, some pages of the app is protected with Flask-Login, I need to add Dash plot to my application, the plot should be on the page which requires authentification. I should add that in addition to Flask Login, I created …

Total answers: 3