0

I need to print "Server is running..." after flask server is started with app.run().
I'm using flask version 1.1.2

I tried using before_first_request decorator, but it doesn't run until first request is sent. Any way to accomplish this?

hiru007
  • 110
  • 3
  • 6
  • Why do you need to perform something like that? – yeger May 26 '23 at 10:28
  • X Y question, could you please provide more context and share your code? – Gameplay May 26 '23 at 10:37
  • 2
    This might answer your question: https://stackoverflow.com/questions/27465533/run-code-after-flask-application-has-started – אוהד סירקיס May 26 '23 at 10:43
  • Please provide enough code so others can better understand or reproduce the problem. – Community May 26 '23 at 16:22
  • I honestly don't know what's so hard to understand about this or why there isn't a hook built-in. If the server isn't ready to accept requests yet, you might want to send a notification when it is ready to accept requests. The answers in that other SO link are all still kind of hacky and some aren't supported anymore – NewEndian Aug 02 '23 at 10:11

0 Answers0