-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
TypeError __str__ returned non-string (type PosixPath) /debug_toolbar/templates/debug_toolbar/panels/staticfiles.html #2002
Comments
Can you share more information about your project? This isn't something we've come across elsewhere. We'd want to know what your static file was and what your installed apps and middlewares are? |
Sure. After switching to ASGI and installing uvicorn, I noticed the event. Legend:
Look for the line {{ staticfile|stringformat:"s" }} is shown on.
|
Whoops, I meant I'd like to reproduce this with one of my applications. I'll see if using uvicorn and asgi with the example app reproduces it, but I may need you to create a reproducible example otherwise. |
Let me know. |
django-debug-toolbar: 4.4.6
I'm just providing a solution to an event I came across. Line 29 for /debug_toolbar/templates/debug_toolbar/panels/staticfiles.html needs to have {{ staticfile }} updated to {{ staticfile|stringformat:"s" }}
Below is the event that happened.
When running uvicorn project.asgi:application --host 127.0.0.1 --port 8001 and then loading 127.0.0.1:8001 in a new web browser, the TypeError str returned non-string (type PosixPath). Specifically focusing on {{ staticfile }}. I updated {{ staticfile }} to {{ staticfile|stringformat:"s" }} and that resolved the TypeError.
Thanks!
The text was updated successfully, but these errors were encountered: