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

No toolbar on either Chrome or firefox #139

Closed
johnxpan opened this issue Aug 16, 2019 · 4 comments
Closed

No toolbar on either Chrome or firefox #139

johnxpan opened this issue Aug 16, 2019 · 4 comments

Comments

@johnxpan
Copy link

I added the flask debug toolbar to my app. It looks working because it gave me the redirect warning like below:

_Redirect (302)
Location: /app/bokeh

The Flask Debug Toolbar has intercepted a redirect to the above URL for debug viewing purposes. You can click the above link to continue with the redirect as normal. If you'd like to disable this feature, you can set the config variable DEBUG_TB_INTERCEPT_REDIRECTS to False._

But there is no FDT tool bar shown up after I got the response. I tried both Chrome and Firefox, same result. Do I need to do any configuration on the browser side to display the toolbar?

@johnxpan
Copy link
Author

It is related to the dynamic routing of docker container. Does anybody know how to configure the host IP address of docker container to bypass the problem? Thanks!

@johnxpan
Copy link
Author

Finally, we found the root cause, our server is a hybrid of both cgi-bin and flask. the invocation url is not "/" but "/app/". The flask debug toolbar by default try to load the toolbar from "https://xyz.com/_debug_toolbar/static/js/toolbar.js",
instead of the correct url:
"https://xyz.com/app/_debug_toolbar/static/js/toolbar.js"
Is there any configuration parameter we can use to set this correct?

@mattaw
Copy link
Contributor

mattaw commented Feb 9, 2020

I don't know if you fixed this, but I run a flask app under a prefix and the proxy supplies the right prefix, and Flask respects it by default so the toolbar works. (There is a bug in the SQLAlchemy EXPLAIN/SELECT sub-panels that I have submitted a pull request for.) You could try setting SCRIPT_NAME in the Flask config if your proxy is not doing it right now?

@jeffwidman
Copy link
Member

Just merged @mattaw 's pull request.

@johnxpan what does Flask think it's home url/prefix is? Ie, is the redirect to /app prefix happening within Flask or externally? If external, then you need to fix your proxy to also redirect the javascript files. Otherwise if within Flask, how are you setting that prefix? Is it for the whole app, or just a sub-blueprint?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants