diff --git a/docker-compose.yml b/docker-compose.yml index e0f81cf5..8d1daa60 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,6 +19,7 @@ web: build: . command: > /bin/bash -c ' + export HOST_IP=$(netstat -nr | grep ^0\.0\.0\.0 | awk "{print \$2}") && sleep 3 && npm install --production --no-bin-links && python manage.py migrate && diff --git a/lore/settings.py b/lore/settings.py index 11b3fb41..44766f30 100644 --- a/lore/settings.py +++ b/lore/settings.py @@ -81,6 +81,8 @@ def get_var(name, default): 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'debug_toolbar', + 'elastic_panel', 'storages', 'compressor', 'bootstrap3', @@ -343,6 +345,22 @@ def get_var(name, default): }, } +DEBUG_TOOLBAR_PANELS = [ + 'debug_toolbar.panels.versions.VersionsPanel', + 'debug_toolbar.panels.timer.TimerPanel', + 'debug_toolbar.panels.settings.SettingsPanel', + 'debug_toolbar.panels.headers.HeadersPanel', + 'debug_toolbar.panels.request.RequestPanel', + 'debug_toolbar.panels.sql.SQLPanel', + 'debug_toolbar.panels.staticfiles.StaticFilesPanel', + 'debug_toolbar.panels.templates.TemplatesPanel', + 'debug_toolbar.panels.cache.CachePanel', + 'debug_toolbar.panels.signals.SignalsPanel', + 'debug_toolbar.panels.logging.LoggingPanel', + 'debug_toolbar.panels.redirects.RedirectsPanel', + 'elastic_panel.panel.ElasticDebugPanel' +] + REST_FRAMEWORK = { 'DEFAULT_PERMISSION_CLASSES': ( 'rest_framework.permissions.IsAuthenticated', @@ -391,5 +409,8 @@ def get_var(name, default): STATSD_PREFIX = get_var('LORE_STATSD_PREFIX', None) STATSD_MAXUDPSIZE = get_var('LORE_STATSD_MAXUDPSIZE', 512) +# Required for Django Debug Toolbar +INTERNAL_IPS = (get_var('HOST_IP', '127.0.0.1'), ) + # Google analytics code GOOGLE_ANALYTICS_ID = get_var('LORE_GOOGLE_ANALYTICS_ID', None) diff --git a/requirements.txt b/requirements.txt index ae32ea75..51a615ee 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,8 @@ Django==1.8.4 django-appconf==1.0.1 django-bootstrap3==6.2.2 django-compressor==1.5 +django-debug-toolbar==1.3.2 +django-elasticsearch-debug-toolbar==0.1.15 django-haystack==2.4.0 djangorestframework==3.2.2 dj-database-url==0.3.0 @@ -19,6 +21,7 @@ static3==0.6.1 tox>=2.0.2,<3.0.0 uwsgi==2.0.11.1 six==1.9.0 +sqlparse==0.1.16 statsd==3.1 git+https://github.com/mitodl/django-settings-export@feature/py3_readme#egg=django-settings-export==1.0.5-odl