mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 09:57:35 -02:30
Merge pull request #3890 from AlanCoding/fix_debug_toolbar
Fix Django debug toolbar after its upgrade Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
@@ -112,14 +112,17 @@ if 'django_jenkins' in INSTALLED_APPS:
|
|||||||
PEP8_RCFILE = "setup.cfg"
|
PEP8_RCFILE = "setup.cfg"
|
||||||
PYLINT_RCFILE = ".pylintrc"
|
PYLINT_RCFILE = ".pylintrc"
|
||||||
|
|
||||||
|
|
||||||
|
# debug toolbar and swagger assume that requirements/requirements_dev.txt are installed
|
||||||
|
|
||||||
INSTALLED_APPS += [ # NOQA
|
INSTALLED_APPS += [ # NOQA
|
||||||
'rest_framework_swagger',
|
'rest_framework_swagger',
|
||||||
'debug_toolbar',
|
'debug_toolbar',
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE += [ # NOQA
|
MIDDLEWARE = [
|
||||||
'debug_toolbar.middleware.DebugToolbarMiddleware',
|
'debug_toolbar.middleware.DebugToolbarMiddleware',
|
||||||
]
|
] + MIDDLEWARE # NOQA
|
||||||
|
|
||||||
DEBUG_TOOLBAR_CONFIG = {
|
DEBUG_TOOLBAR_CONFIG = {
|
||||||
'ENABLE_STACKTRACES' : True,
|
'ENABLE_STACKTRACES' : True,
|
||||||
|
|||||||
@@ -21,6 +21,12 @@ ADMINS = (
|
|||||||
|
|
||||||
MANAGERS = ADMINS
|
MANAGERS = ADMINS
|
||||||
|
|
||||||
|
# Enable the following lines and install the browser extension to use Django debug toolbar
|
||||||
|
# if your deployment method is not VMWare of Docker-for-Mac you may
|
||||||
|
# need a different IP address from request.META['REMOTE_ADDR']
|
||||||
|
# INTERNAL_IPS = ('172.19.0.1', '172.18.0.1', '192.168.100.1')
|
||||||
|
# ALLOWED_HOSTS = ['*']
|
||||||
|
|
||||||
# Database settings to use PostgreSQL for development.
|
# Database settings to use PostgreSQL for development.
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
|
|||||||
14
awx/urls.py
14
awx/urls.py
@@ -2,6 +2,7 @@
|
|||||||
# All Rights Reserved.
|
# All Rights Reserved.
|
||||||
|
|
||||||
from django.conf.urls import url, include
|
from django.conf.urls import url, include
|
||||||
|
from django.conf import settings
|
||||||
from awx.main.views import (
|
from awx.main.views import (
|
||||||
handle_400,
|
handle_400,
|
||||||
handle_403,
|
handle_403,
|
||||||
@@ -21,6 +22,19 @@ urlpatterns = [
|
|||||||
url(r'^(?:api/)?500.html$', handle_500),
|
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'
|
handler400 = 'awx.main.views.handle_400'
|
||||||
handler403 = 'awx.main.views.handle_403'
|
handler403 = 'awx.main.views.handle_403'
|
||||||
handler404 = 'awx.main.views.handle_404'
|
handler404 = 'awx.main.views.handle_404'
|
||||||
|
|||||||
Reference in New Issue
Block a user