Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug=True doesn't work | Bottle 0.12.25 version #1441

Closed
Armen-Jean-Andreasian opened this issue Feb 14, 2024 · 2 comments
Closed

debug=True doesn't work | Bottle 0.12.25 version #1441

Armen-Jean-Andreasian opened this issue Feb 14, 2024 · 2 comments

Comments

@Armen-Jean-Andreasian
Copy link

Armen-Jean-Andreasian commented Feb 14, 2024

Howdy! Decided to discover other libraries today, so I took Bottle.
I liked it. 'Hit Ctrl-C to quit' was fun. Like 'Smash Ctrl-C to quit".

However, I noticed probably a bug. I used the simplest snippet:

from bottle import Bottle, run

app = Bottle()


@app.route(path='/')
@app.route(path='/<name>', method='GET')
def main(name=None):
    if name:
        return {'message': f"hello {name}"}
    else:
        return {'message': f"hello world"}


if __name__ == '__main__':
    run(app, host='127.0.0.1', port=5000, debug=True)

So, for this code during the runtime with turned on debug mode I change {'message': f"hello world"} to {'message': f"hello no world"} and the response is still {'message': "hello world"}. Whereas the logs are 127.0.0.1 - - [14/Feb/2024 14:25:58] "GET / HTTP/1.1" 200 26

Done list:

  • Restart PyCharm (I use PyCharm Community Edition 2023.1.4)
  • Reinstall the bottle
  • Switch the venv to global
  • Force refresh the page with "Shift + F5"

The issue still persists.
Hope this information will be helpful for you. Good luck.

UPD:

import requests

print(requests.get('http://127.0.0.1:5000/').json())

Just tested with requests and the issue persists.

@defnull
Copy link
Member

defnull commented Feb 14, 2024

Debug mode does not enable code reloading on change, just more detailed error messages. See https://bottlepy.org/docs/dev/api.html#bottle.run You are looking for the reloader parameter?

@codeawn
Copy link

codeawn commented Feb 25, 2024

it should reloader=True

@defnull defnull closed this as completed Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants