From 6d94aa84e7697c05c9641325fb8f2f76a694dee2 Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Fri, 3 Apr 2026 10:22:21 -0400 Subject: [PATCH] Reorder URLs so that Django debug toolbar can work (#16352) * Reorder URLs so that Django debug toolbar can work * Move comment with URL move --- awx/urls.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/awx/urls.py b/awx/urls.py index 9fe1ea0286..95b17474df 100644 --- a/awx/urls.py +++ b/awx/urls.py @@ -34,9 +34,6 @@ def get_urlpatterns(prefix=None): re_path(r'^(?:api/)?500.html$', handle_500), re_path(r'^csp-violation/', handle_csp_violation), 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')), ] if settings.DYNACONF.is_development_mode: @@ -47,6 +44,12 @@ def get_urlpatterns(prefix=None): except ImportError: pass + # want api/v2/doesnotexist to return a 404, not match the ui urls, + # so use a negative lookahead assertion in the pattern below + urlpatterns += [ + re_path(r'^(?!api/).*', include('awx.ui.urls', namespace='ui')), + ] + return urlpatterns