I see below error even after setting secret_key, unable to figure out what i'm missing here please advice
Error:
RuntimeError: The session is unavailable because no secret key was set. Set the secret_key on the application to something unique and secret.
Code below
config.py
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
#from .models import db
db = SQLAlchemy()
def create_app():
app = Flask(__name__)
app.config['secret_key'] = 'x90vvxddx11?<xbf xd3xb2xabx12xb5xa3xee'
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://postgres:admin@localhost:5432/WebApp'
db.init_app(app)
login_manager = LoginManager()
login_manager.login_view = 'auth.login'
login_manager.init_app(app)
from .models import Person
@login_manager.user_loader
def load_user(user_id):
return Person.query.get(int(user_id))
from .auth import auth as auth_blueprint
app.register_blueprint(auth_blueprint)
return app