Skip to content

Commit

Permalink
Merge pull request #1094 from rafalp/fix-debug-toolbar
Browse files Browse the repository at this point in the history
Always display debug toolbar in dev project
  • Loading branch information
rafalp committed Sep 11, 2018
2 parents b267315 + 9221f99 commit 88b3144
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
13 changes: 12 additions & 1 deletion misago/bin/misago-start-devproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,18 @@ def fill_in_settings(f):
s = s.replace("'HOST': 'localhost',", "'HOST': os.environ.get('POSTGRES_HOST'),")

# Specify console backend for email
s += "\nEMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'\n"
s += "\n# Set dev instance to send e-mails to console"
s += "\n"
s += "\nEMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'"
s += "\n"

# Tie Debug Toolbar visibility to env variable
s += "\n# Display debug toolbar if IN_MISAGO_DOCKER enviroment var is set to \"1\""
s += "\n"
s += "\nDEBUG_TOOLBAR_CONFIG = {"
s += "\n 'SHOW_TOOLBAR_CALLBACK': 'misago.conf.debugtoolbar.enable_debug_toolbar'"
s += "\n}"
s += "\n"

# Empty the contents of STATICFILES_DIRS (STATICFILES_DIRS = [])
pos = s.find('STATICFILES_DIRS')
Expand Down
5 changes: 5 additions & 0 deletions misago/conf/debugtoolbar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import os


def enable_debug_toolbar(_):
return os.environ.get('IN_MISAGO_DOCKER', '').lower() == "1"

0 comments on commit 88b3144

Please sign in to comment.