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
StatementError: SQLite Date type only accepts Python date objects as input
I am using Flask-Security, the code seems fine, but when inserting a data from register view it gives the bellow error. Since I made SECURITY_TRACKABLE = True I added some extra fields in my models and the problem might be there…

Max
- 2,425
- 6
- 35
- 54
0
votes
1 answer
Flask-Security error "User object has no attribute roles'
This is my first time using Flask-Security, and I can't seem to successfully create a user.
Every time I try, I get a "User object has no attribute roles" error.
Here is the relevant…

ian
- 593
- 2
- 6
- 16
0
votes
1 answer
flask-security encrypt_password('mypassword') varies every time when i reload the page
I've already configured SECURITY_PASSWORD_SALT and use "bcrypt". But every time i reload the page print encrypt_password('mypassword') will print different values, so i can't verify user input password via verify_password(form.password.data,…

cbsw
- 283
- 3
- 8
0
votes
1 answer
Protecting part of a page with Flask-Security
I have a web page generated by Flask that should show content depending on the status of a user.
At the moment, the relevant part of the jinja2 template looks like this:
{% if service.spotting_data.loco_id %}
Spotter Info *:
{% if…
{% if…

Matthew Macdonald-Wallace
- 61
- 1
- 1
- 3
0
votes
1 answer
Flask-security: registration processing renders user.role_id may not be NULL error
I am trying to make registration in my Flask app work. I have already created two roles ("admin" and "user") and one admin (me) without any problems. However, when I try to register a new user through the registration page, I get the following…

Ben
- 1,561
- 4
- 21
- 33
0
votes
1 answer
Flask-Security: user does not persist into database upon registeration
User is able to register and confirm their mail but when the flask server is shut down and restarted, it no longer remembers any of the previous registered users, forcing people to sign up all over again.
How can I debug this? I am on ubuntu 12.04…

I Love Python
- 862
- 2
- 13
- 20
0
votes
0 answers
Python: Flask-security, register does not persist user
Everything else is working fine, registration works and I am logged in but as soon as I log out, it says the user does not exist. I suspect it's expecting a confirm link email but these are my settings:
app.config['SECURITY_REGISTERABLE'] =…

I Love Python
- 862
- 2
- 13
- 20
0
votes
1 answer
flask security auth_token_required - token authentication
I've successfully implemented token auth and protect my rest web service method with it - this is great approach.
Now I have trouble to access user data from token - like ID - in order to manipulate with it in accessed (protected) rest service…

Vukasin
- 561
- 5
- 9
0
votes
1 answer
How to add parameters to User class in Flask-Security
I'm trying to add another column in my User class for an API key. However, I get an error with my kwargs when using Flask-Security.
class User(db.Model, UserMixin):
__tablename__ = 'usermod'
id = db.Column(db.Integer(), primary_key=True)
…

jmnwong
- 1,577
- 6
- 22
- 33
-1
votes
1 answer
Why am i getting this error: TypeError: LoginForm.validate() got an unexpected keyword argument 'extra_validators'
I am get
ting t
his error when i try to log in my application with flask, i am using mongodb for my database. This is all the code from app.py
from flask import Flask, render_template, request, redirect, url_for
from flask_mongoengine import…

Levizoca
- 1
-1
votes
1 answer
Simplest way to securely distinguish between admins and other users in Flask
Forgive my naivety here, but I've been looking into various solutions for role authentication in Flask, and it seems that several extensions are no longer being maintained. This got me wondering whether I require any of them beyond Flask Login for…

dannypernik
- 172
- 2
- 11
-1
votes
1 answer
I want to implement manager class. So when we create user, we can define manager and under that defined manager we will create user
roles users = db.Table(
'roles_users',
db.Column('user_id', db.Integer(), db.ForeignKey('user.id')),
db.Column('role_id', db.Integer(), db.ForeignKey('role.id'))
)
Above mentioned code is for roles_users table
class Role(db.Model,…

Kenil Shah
- 1
- 2
-1
votes
1 answer
Is there any way to use a react js frontend to call flask security features?
I have an application which uses flask and flask-security-too in the rest layer. Since flask-security contains some nice, out-of-the-box solutions for user signup, registration etc. including some override-able views. I would really like to use it…

Fjurg
- 487
- 3
- 10
-1
votes
1 answer
Flask security @roles_accepted from path name
@app.route('//glc')
# @roles_accepted('admin',charity_id[:3])
def GLC(charity_id):
...
...
return render_template('one.html',charity_id=charity_id)
Is there a way of allowing a role, as defined by first 3 characters…

tedioustortoise
- 259
- 3
- 20
-1
votes
1 answer
Exception: Cannot assign two Admin() instances with same URL and subdomain to the same application
I am trying to restrict access to admin panel using flask-admin but i am getting error. I have also tried changing url name but then it throws 404 error. When using flask-admin with ModelView getting the following error:
Exception: Cannot assign…

gujaratiraja
- 371
- 2
- 19