-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An error occurred when create_app was executed twice #75
Comments
same here. damned flask and his not supported batteries |
Using app factory for testing. This problem is still there and driving me crazy. Please fix it! (There is already a PR commit 1c1f790) If modifying db is not graceful: for c in self.db.Model._decl_class_registry.values():
if hasattr(c, '__table__') and c.__table__.fullname == table:
self.sql_session_model = c
return Before defining class |
I'd like to update @AllanChain's response which worked wonders for me. It appears since sqlalchemy 1.4 (sqlalchemy/sqlalchemy#6080) |
This issuse is now fixed from 0.7.0 |
This is create_app function:
Then exec this code:
An error occurred:
If I comment
sess.init_app(app)
, this code works fine.I guess that the two app instance shared the same database, repeat exec the function create_all(), my own definition of those tables can be created good, but the sessions table by using flask-session can not work in this situation.
The text was updated successfully, but these errors were encountered: