mirror of
https://github.com/Doctorado-ML/beflask.git
synced 2025-08-15 07:05:51 +00:00
restore access to flask shell
This commit is contained in:
@@ -26,7 +26,7 @@ def make_shell_context():
|
|||||||
return {"db": db, "User": User}
|
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:
|
if config_name is None:
|
||||||
config_name = os.environ.get("BEFLASK_ENV", "development")
|
config_name = os.environ.get("BEFLASK_ENV", "development")
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
@@ -47,5 +47,7 @@ def create_app(config_name=None):
|
|||||||
from .interactive.main_interactive import interactive
|
from .interactive.main_interactive import interactive
|
||||||
|
|
||||||
app.register_blueprint(interactive, url_prefix="/admin")
|
app.register_blueprint(interactive, url_prefix="/admin")
|
||||||
|
if return_socketio:
|
||||||
return socketio, app
|
return socketio, app
|
||||||
|
else:
|
||||||
|
return app
|
||||||
|
2
run.py
2
run.py
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
from beflask import app
|
from beflask import app
|
||||||
|
|
||||||
socketio, app = app.create_app()
|
socketio, app = app.create_app(return_socketio=True)
|
||||||
socketio.run(app, debug=app.config["DEBUG"])
|
socketio.run(app, debug=app.config["DEBUG"])
|
||||||
|
Reference in New Issue
Block a user