django-commons / django-debug-toolbar

A configurable set of panels that display various debug information about the current request/response.
https://django-debug-toolbar.readthedocs.io
BSD 3-Clause "New" or "Revised" License
8.08k stars 1.05k forks source link

slug with underscore only replacing space #2009

Closed MalikRumi closed 2 weeks ago

MalikRumi commented 2 weeks ago

I am running down a 'no reverse match' issue, and I noticed that there was a slug made from substituting spaces with underscores, but leaving commas and periods. This is not the algorithm used by slugify(). I've been looking around my codebase, but I have not been able to figure out where this slug came from. The reason I am posting about it here is because your traceback page is the only place I have found it. Under reverse() it has the underscored slug as self. Then under that it has the normal, expected slug as kwargs. If these two thing are being compared then a no reverse match seems likely because the underscores are not dashes. Where is ddt getting the self with underscores?

Screenshot 2024-10-04 at 04 31 15
matthiask commented 2 weeks ago

This looks like the default Django internal error template, not the toolbar. (The toolbar handle is to the upper right of the browser window in a collapsed state.)

You'll probably have more luck asking your question in the Django Forum or maybe the Django Discord.

Here's some ideas to get you started: Maybe you're using prepopulated_fields and someone edited the slug by hand? Maybe slug isn't actually a SlugField and allows more characters which are rejected by the <slug> URL converter?

I'm going to close this issue, because it doesn't have anything to do with the toolbar, but I wish you good luck!

tim-schilling commented 2 weeks ago

I'm sorry to say, but this isn't a problem with the debug toolbar. It's likely however that reverse is being called, the slug is the value you don't expect.

My suggestion would be to accept that as true, then consider what else would have to be true for that to happen.

If you have something that shows the toolbar is at fault, we're happy to look at it.

MalikRumi commented 2 weeks ago

ok, will do. thanks. I always thought this page was from the toolbar because it is so detailed and most of the others are like a tenth the length of this one. I should brush up on the toolbar!