restore access to flask shell

This commit is contained in:
2023-06-13 00:04:08 +02:00
parent b3afd580e0
commit d4d61cfd36
2 changed files with 6 additions and 4 deletions

View File

@@ -26,7 +26,7 @@ def make_shell_context():
return {"db": db, "User": User}
def create_app(config_name=None):
def create_app(config_name=None, return_socketio=False):
if config_name is None:
config_name = os.environ.get("BEFLASK_ENV", "development")
app = Flask(__name__)
@@ -47,5 +47,7 @@ def create_app(config_name=None):
from .interactive.main_interactive import interactive
app.register_blueprint(interactive, url_prefix="/admin")
if return_socketio:
return socketio, app
else:
return app

2
run.py
View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python
from beflask import app
socketio, app = app.create_app()
socketio, app = app.create_app(return_socketio=True)
socketio.run(app, debug=app.config["DEBUG"])