diff --git a/neboard/settings.py b/neboard/settings.py --- a/neboard/settings.py +++ b/neboard/settings.py @@ -1,6 +1,5 @@ # Django settings for neboard project. import os -import markdown from boards.mdx_neboard import markdown_extended DEBUG = True @@ -82,7 +81,6 @@ STATICFILES_DIRS = ( STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', -# 'django.contrib.staticfiles.finders.DefaultStorageFinder', ) if DEBUG: @@ -99,7 +97,6 @@ SECRET_KEY = '@1rc$o(7=tt#kd+4s$u6wchm** TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', -# 'django.template.loaders.eggs.Loader', ) TEMPLATE_CONTEXT_PROCESSORS = ( @@ -113,11 +110,8 @@ MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', -# 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', - # Uncomment the next line for simple clickjacking protection: - # 'django.middleware.clickjacking.XFrameOptionsMiddleware' 'boards.middlewares.BanMiddleware', ) @@ -150,6 +144,19 @@ INSTALLED_APPS = ( 'boards', 'captcha', 'south', + 'debug_toolbar', +) + +DEBUG_TOOLBAR_PANELS = ( + 'debug_toolbar.panels.version.VersionDebugPanel', + 'debug_toolbar.panels.timer.TimerDebugPanel', + 'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel', + 'debug_toolbar.panels.headers.HeaderDebugPanel', + 'debug_toolbar.panels.request_vars.RequestVarsDebugPanel', + 'debug_toolbar.panels.template.TemplateDebugPanel', + 'debug_toolbar.panels.sql.SQLDebugPanel', + 'debug_toolbar.panels.signals.SignalDebugPanel', + 'debug_toolbar.panels.logger.LoggingPanel', ) # TODO: NEED DESIGN FIXES @@ -190,6 +197,7 @@ MARKUP_FIELD_TYPES = ( ('markdown', markdown_extended), ) # Custom imageboard settings +# TODO These should me moved to MAX_POSTS_PER_THREAD = 10 # Thread bumplimit MAX_THREAD_COUNT = 500 # Old threads will be deleted to preserve this count THREADS_PER_PAGE = 10 @@ -212,6 +220,20 @@ ENABLE_CAPTCHA = False CAPTCHA_DEFAULT_SAFE_TIME = 30 # seconds POSTING_DELAY = 30 # seconds + +def custom_show_toolbar(request): + return DEBUG + +DEBUG_TOOLBAR_CONFIG = { + 'INTERCEPT_REDIRECTS': False, + 'SHOW_TOOLBAR_CALLBACK': custom_show_toolbar, + 'HIDE_DJANGO_SQL': False, + 'ENABLE_STACKTRACES': True, +} + # Debug mode middlewares if DEBUG: - MIDDLEWARE_CLASSES += ('boards.profiler.ProfilerMiddleware',) + MIDDLEWARE_CLASSES += ( + 'boards.profiler.ProfilerMiddleware', + 'debug_toolbar.middleware.DebugToolbarMiddleware', + )