Reorder URLs so that Django debug toolbar can work#16352
Reorder URLs so that Django debug toolbar can work#16352AlanCoding wants to merge 1 commit intoansible:develfrom
Conversation
📝 WalkthroughWalkthroughThe UI URL resolver inclusion was moved from the initial Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| re_path(r'^login/', handle_login_redirect), | ||
| # want api/v2/doesnotexist to return a 404, not match the ui urls, | ||
| # so use a negative lookahead assertion here | ||
| re_path(r'^(?!api/).*', include('awx.ui.urls', namespace='ui')), |
There was a problem hiding this comment.
Comment now separated from the code it describes
Low Severity
The comment on lines 37–38 ("so use a negative lookahead assertion here") originally sat directly above the re_path(r'^(?!api/).*', ...) pattern. After the move, the comment remains at the end of one urlpatterns block while the pattern it describes is now in a separate urlpatterns += block ~12 lines later. The word "here" no longer refers to anything nearby, making the comment misleading. The comment would be more useful if it traveled with the pattern it explains.
Additional Locations (1)
|





SUMMARY
Go discover your internal IP and then put in:
and then try and use the django debug toolbar, was giving this when looking for the SQL:
This fixes it.
The issue is that the UI urls were getting included unconditionally before the DDT urls, and that means that it would match the /debug/ URL that's necessary for the thing to work.
ISSUE TYPE
COMPONENT NAME
Note
Low Risk
Low risk ordering change to URL patterns; main risk is unintended routing precedence changes for non-API paths in development mode.
Overview
Reorders URL registration so the UI catch-all route (
re_path(r'^(?!api/).*'...)) is appended after the optional Django Debug Toolbar routes.This prevents
/__debug__/requests from being swallowed by the UI URL include whensettings.DYNACONF.is_development_modeis enabled.Written by Cursor Bugbot for commit f5d8433. This will update automatically on new commits. Configure here.
Summary by CodeRabbit