Open sistemicorp opened 5 years ago
Hello!
The peewee example from the Flask-Security website is quite outdated. flask-peewee
is deprecated. I suggest you try the following snippet:
from peewee import *
from playhouse.flask_utils import FlaskDB
from flask_security import Security, PeeweeUserDatastore, \
UserMixin, RoleMixin, login_required
# Create app
app = Flask(__name__)
app.config['DEBUG'] = True
app.config['SECRET_KEY'] = 'super-secret'
app.config['DATABASE'] = {
'name': 'example.db',
'engine': 'peewee.SqliteDatabase',
}
# Create database connection object
db = FlaskDB(app) # note that I used FlaskDB instead of Database
I made the above changes and my program still works. Thank you.
When I try and run the example here I get the following traceback,
To fix the problem, I changed the import order to,
Versions: flask-peewee==3.0.3 peewee==3.10.0