I need to add some preconfig params to setup app before running manager's run method and I need to get them using arguments. Once, I get them run_app will do the rest.
My issue here is the following: the only way to pass arguments to manager is to add them to the run command function which is executed after run_app call. Adding a argument interface with argparse before run_app execution doesn't work either, because it causes a conflict error with flask's manager. Do you know of any approach I could take to solve this problem?
from flask_script import Manager
from app_file import run_app
#get params here
app = run_app(params)
manager = Manager(app)
@manager.command
def routes():
print(app.url_map)
@manager.command
def run(debug=True):
routes()
app.run(ssl_context='adhoc', debug=debug, host="0.0.0.0", port=5000)
if __name__ == '__main__':
manager.run()
I'm running the app by calling python manager run
Thanks for the help :-)