Flask-Security is a Flask extension which adds basic security and authentication features to your Flask apps quickly and easily. It additionally bootstraps your application with various views for handling its configured features to get you up and running as quick as possible.
Questions tagged [flask-security]
319 questions
0
votes
1 answer
Trouble logging in with Flask-Security: 'User' has no attribute 'get_user'
When I use Flask-Security's login form, I get the following error. It's telling me that I don't have a get_user method, (which is a part of my user_datastore).
Traceback (most recent call last):
File…

dadiletta
- 299
- 3
- 17
0
votes
1 answer
python import conflict with flask-security
I run into this "import conflict" fairly often I'm trying to find the most Python way to solve it. My app's __init__ instantiates db and over in my user.models file, db is referenced extensively. However, to use Flask-Security, I need to initialize…

dadiletta
- 299
- 3
- 17
0
votes
1 answer
Trying to implement flask-security
I am trying to create a skeleton and I am using flask security for the login/admin.
Inside my app folder I have a function where I create my app:
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_security import Security,…

spitfiredd
- 2,897
- 5
- 32
- 75
0
votes
0 answers
Flask-Security API Token
I have a Flask-Admin app running with Flask-Security and use a token based authentication for API calls. Everything was working correctly. The following method is what returned the token.
def get_token(self):
url = 'http://nginx/login'
…
user6723321
0
votes
1 answer
Using flask-security as a part of an REST API
I am currently in the process of building an REST API with flask-security. Fortunately flask-security has a lot of views and templates, which i won't need in my case. I am obviously not able to override them by reimplementing e.g.…

JavaCake
- 4,075
- 14
- 62
- 125
0
votes
1 answer
Setting up Flask-Admin and Flask-Security
I have a Flask-Admin project set up with Flask-Security as well. It is pretty much https://pythonhosted.org/Flask-Security/quickstart.html#id1 but just more advanced. I can access the login page at localhost/login and logout and localhost/logout.…
user6723321
0
votes
2 answers
Flask-Security templates not taking effect
I am using Flask-Security with my Flask-Admin app.
The login.html template current is:
% extends "base.html" %}
{% from "security/_macros.html"
import render_field_with_errors, render_field %}
{% block content %}
{% include…
user6723321
0
votes
1 answer
Flask Security, Flask Mail AttributeError: 'NoneType' object has no attribute 'send'
I'm trying to implement the email function inside my Flask admin panel.
I've successfully integrated it within my admin panel but the problem is when I try to send any mail, it gives me below error with…

Jessi
- 1,378
- 6
- 17
- 37
0
votes
1 answer
Hide Flask-Admin route
I'm building a Flask blog and setting up an admin interface now. I've read about setting up security for Flask-Admin. I've managed to set up security (access is restricted only to logged-in users) for all my models, but users can still access the…

cnstlungu
- 547
- 1
- 9
- 22
0
votes
1 answer
How to embed the user registration template within the frontpage with Flask-security?
Flask-security provides a template for registering new users.
I want to include a form in the frontpage of my site for user registrations. Can I somehow embed flask-security template + endpoint/function in my home endpoint? Or do I have to create a…

user1294122
- 323
- 1
- 3
- 14
0
votes
1 answer
How could you refactor current_user in User.query.all() in Flask-Security?
Index page should be shown only to logged in users and redirect other users to landing page.
@app.route('/')
def index():
if current_user in User.query.all():
return render_template('index.html')
else:
return…

hooligan
- 15
- 6
0
votes
0 answers
Form update and display data in same page Flask project
I am getting confused on how to implement this. Basically, I have edit_profile page where after login, user gets redirected to this page to fill in his profile. User can fill in his data, click save and then it saves the data in MySQL and comes back…

JPro
- 6,292
- 13
- 57
- 83
0
votes
1 answer
flask-security roles_required with pluggable views
I'm trying to require a role to access a view that I've defined as a MethodView. However, I can't seem to get the route to be named correctly.
If I simply require logging in with a decorator everything works:
activities = Blueprint("activities",…

Plasma
- 2,369
- 1
- 29
- 35
0
votes
1 answer
Flask-Security - Username to generate auth token instead of email
I am developing an application using Flask and using Flask-security for token based authentication feature.
I developed a prototype code looking at docs and different examples I could find on internet. I see 'email' field is required to get a auth…

user1484793
- 359
- 3
- 16
0
votes
1 answer
How to redirect after successful login and register in Flask-Security? And Error
How to redirect with successful register to a different html page than Default:'/'
redirect say to the profile page of the user logged in.
and after registering I have this error
AttributeError: 'NoneType' object has no attribute 'send'
Traceback…

maharshi
- 586
- 12
- 30