mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 14:57:39 -02:30
fix Django debug toolbar after its upgrade
This commit is contained in:
14
awx/urls.py
14
awx/urls.py
@@ -2,6 +2,7 @@
|
||||
# All Rights Reserved.
|
||||
|
||||
from django.conf.urls import url, include
|
||||
from django.conf import settings
|
||||
from awx.main.views import (
|
||||
handle_400,
|
||||
handle_403,
|
||||
@@ -21,6 +22,19 @@ urlpatterns = [
|
||||
url(r'^(?:api/)?500.html$', handle_500),
|
||||
]
|
||||
|
||||
if settings.SETTINGS_MODULE == 'awx.settings.development':
|
||||
try:
|
||||
import debug_toolbar
|
||||
urlpatterns += [
|
||||
# for Django version 2.0
|
||||
# path('__debug__/', include(debug_toolbar.urls)),
|
||||
|
||||
# TODO: this is the Django < 2.0 version, REMOVEME
|
||||
url(r'^__debug__/', include(debug_toolbar.urls))
|
||||
]
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
handler400 = 'awx.main.views.handle_400'
|
||||
handler403 = 'awx.main.views.handle_403'
|
||||
handler404 = 'awx.main.views.handle_404'
|
||||
|
||||
Reference in New Issue
Block a user