Commit 216ef2d4 authored by Floréal Cabanettes's avatar Floréal Cabanettes

Make session persistent and store it in MongoDB

parent 94731156
......@@ -9,6 +9,7 @@ from settings import DB_NAME, SITE_NAME, TIMEZONE, LOCALE
from werkzeug.exceptions import NotFound
from flask_babel import Babel
from flask_babel import gettext as _
from flask_session import Session
from mongoengine.errors import DoesNotExist
from view.register import page as register
......@@ -25,9 +26,12 @@ app = Flask(__name__)
app.config['MONGODB_DB'] = DB_NAME
app.config['BABEL_DEFAULT_LOCALE'] = LOCALE
app.config['BABEL_DEFAULT_TIMEZONE'] = TIMEZONE
app.config['SESSION_TYPE'] = 'mongodb'
app.config['SESSION_MONGODB_DB'] = DB_NAME
app.register_blueprint(register)
app.register_blueprint(panel)
app.secret_key = SECRET_KEY
Session(app)
babel = Babel(app)
db = MongoEngine(app)
......
......@@ -4,3 +4,4 @@ mongoengine
babel
flask-babel
flask-bcrypt
flask-session
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment