Issue
Hey trying to get a script to run once flask has been started but before the first request.
Looking at @app.before_first_request method, this seems to wait for a request before running. Another possible option is using the flask_script library. Most likely will end up using this, but wanted to see if anyone had any other suggestion that didn't include needing new libraries.
Cheers,
Solution
Put your code here:-
if __name__ == "__main__":
#write your code here to execute first when the app run
Answered By - Fasil K
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.