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

try version 1.1, 1.2, 1.3 but never see the toolbar #6

Closed
ericfran opened this issue Aug 7, 2021 · 5 comments
Closed

try version 1.1, 1.2, 1.3 but never see the toolbar #6

ericfran opened this issue Aug 7, 2021 · 5 comments

Comments

@ericfran
Copy link

ericfran commented Aug 7, 2021

Hi,
I try it in a very simple Fastapi apps alike:
from debug_toolbar.middleware import DebugToolbarMiddleware
from fastapi import FastAPI

app = FastAPI(debug=True)
app.add_middleware(DebugToolbarMiddleware)

@app.get("/")
async def root():
return {"message": "Hello World"}

start with :uvicorn main :app

and doesn't works , I don't see the toolbar

logs:
INFO: Application startup complete.
INFO: 127.0.0.1:61005 - "GET / HTTP/1.1" 200 OK
INFO: 127.0.0.1:61005 - "GET /docs HTTP/1.1" 200 OK
INFO: 127.0.0.1:61005 - "GET /_debug_toolbar/static/css/toolbar.css HTTP/1.1" 304 Not Modified
INFO: 127.0.0.1:50609 - "GET /_debug_toolbar/static/js/toolbar.js HTTP/1.1" 304 Not Modified
INFO: 127.0.0.1:61063 - "GET /_debug_toolbar/static/js/refresh.js HTTP/1.1" 304 Not Modified
INFO: 127.0.0.1:60063 - "GET /_debug_toolbar/static/img/icon-white.svg HTTP/1.1" 304 Not Modified
INFO: 127.0.0.1:61063 - "GET /_debug_toolbar/static/css/print.css HTTP/1.1" 304 Not Modified
INFO: 127.0.0.1:60063 - "GET /openapi.json HTTP/1.1" 200 OK

@mongkok
Copy link
Owner

mongkok commented Aug 7, 2021

Hey @ericfran ,
You can see a tab on the right side of any HTML page (e.g. Swagger UI /docs), please click it to open the toolbar.
The tab can also be dragged up or down to place it wherever you like.

Debug Toolbar

@ericfran
Copy link
Author

ericfran commented Aug 7, 2021 via email

@mongkok
Copy link
Owner

mongkok commented Aug 8, 2021

if you can't see it.. let me know :)

@mongkok mongkok closed this as completed Aug 24, 2021
@josdavidmo
Copy link

Hi! I have the same issue!

INFO: 172.18.0.1:36844 - "GET /css/toolbar.css HTTP/1.1" 304 Not Modified
INFO: 172.18.0.1:36814 - "GET /img/icon-white.svg HTTP/1.1" 304 Not Modified
INFO: 172.18.0.1:36828 - "GET /js/toolbar.js HTTP/1.1" 304 Not Modified

Could you please help me?

This is my requirements.txt file

alembic==1.11.3
bcrypt==4.0.1
boto3==1.28.35
cryptography==41.0.3
email-validator==2.0.0.post2
fastapi==0.103.0
mangum==0.17.0
passlib==1.7.4
pydantic_settings==2.0.3
PyMySQL==1.1.0
pytz==2023.3
python-dateutil==2.8.2
SQLAlchemy==2.0.20
sentry-sdk[fastapi]==1.29.2
pynamodb==5.5.0
dynamodb-json==1.3
python-jose[cryptography]==3.3.0
requests==2.31.0

Also, I'm using Docker to running the app with uvicorn

main:app --reload --host 0.0.0.0 --port 8000

@josdavidmo
Copy link

I discovered some things:

I need to define the api_url y static_url to make the resources work, because uvicorn not work with _ or create de 304.

app.add_middleware(
    DebugToolbarMiddleware,
    api_url=f"/{settings.PROJECT_NAME}/debug",
    static_url=f"/{settings.PROJECT_NAME}/debug/static",
    ...
)

But the problem is that app not load the docs URI... I think that is a uvicorn problem

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