question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enhancement: before_first_request

See original GitHub issue

None of the solutions from Run a function once on bottle.py startup are perfect.

Is there a before_first_request (like in Flask) planned for 0.13? (Or maybe another solution is already present in 0.12?)

@app.before_first_request
def test():
    print("hello")

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
defnullcommented, Jul 18, 2022

Bottle also ‘lies’ in its run() and prints Listening to ... before the server adapter is actually loaded. I think that’s forgivable 😃

0reactions
josephernestcommented, Aug 3, 2022

Thanks @defnull! Oh good to know it’s deprecated also for Flask. You’re right: I don’t need it. I thought I needed to wait for the server to be ready to take requests before launching chrome.exe http://127.0.0.1/, but in fact the problem I was encountering was somewhere else: https://github.com/bottlepy/bottle/issues/1389. Solved!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add option to prefetch jwks before first request, and refresh it ...
Expected Behavior JWKS fetching should not have influence on response times on resource server. It should be fetched immediately on start ...
Read more >
Changes — Flask Documentation (2.2.x)
Enhance typing of app.errorhandler decorator. ... Changed logic of before first request handlers to flip the flag after invoking. This will allow some...
Read more >
T1190 gpg-agent asks same passphrase multiple times when ...
gpg-agent asks same passphrase multiple times when subsequent requests are made before first request's passphrase is entered. Closed, DuplicatePublic. Actions.
Read more >
Payment by Electronic Funds Transfer - Other than System for ...
... days after award, days before first request, the date specified for receipt of offers if the provision at 52.232-38 is utilized, or...
Read more >
Grouper Product Roadmap - Confluence Mobile - Internet2 Wiki
What Happened? Item Description 2.6 (DONE) Add OIDC UI authn OIDC UI 2.6 (DONE) Finalize LDAP provisioner 2.6 (DONE) Add Google provisioner
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found