Make custom middleware use new style vs old

This commit is contained in:
beeankha
2019-05-09 16:11:53 -04:00
parent 97dc77ea63
commit 68800d0e8e
5 changed files with 87 additions and 57 deletions

View File

@@ -93,7 +93,7 @@ INSIGHTS_TRACKING_STATE = False
# Use Django-Jenkins if installed. Only run tests for awx.main app.
try:
import django_jenkins
INSTALLED_APPS += (django_jenkins.__name__,) # noqa
INSTALLED_APPS += [django_jenkins.__name__,] # noqa
PROJECT_APPS = ('awx.main.tests', 'awx.api.tests',)
except ImportError:
pass
@@ -112,7 +112,18 @@ if 'django_jenkins' in INSTALLED_APPS:
PEP8_RCFILE = "setup.cfg"
PYLINT_RCFILE = ".pylintrc"
INSTALLED_APPS += ('rest_framework_swagger',)
INSTALLED_APPS += [ # NOQA
'rest_framework_swagger',
'debug_toolbar',
]
MIDDLEWARE += [ # NOQA
'debug_toolbar.middleware.DebugToolbarMiddleware',
]
DEBUG_TOOLBAR_CONFIG = {
'ENABLE_STACKTRACES' : True,
}
# Configure a default UUID for development only.
SYSTEM_UUID = '00000000-0000-0000-0000-000000000000'
@@ -162,9 +173,3 @@ except Exception:
os.environ['SDB_NOTIFY_HOST'] = os.popen('ip route').read().split(' ')[2]
WEBSOCKET_ORIGIN_WHITELIST = ['https://localhost:8043', 'https://localhost:3000']
MIDDLEWARE = [
# ...
'debug_toolbar.middleware.DebugToolbarMiddleware',
# ...
]