From b7dab70628e58dcccce0577f4735711de1f6f9ac Mon Sep 17 00:00:00 2001 From: Will Daly Date: Tue, 5 Nov 2013 16:40:23 +0000 Subject: [PATCH] Added devstack settings Fixed pep8/pylint violations Added email feature flags; use full names for pylint disables --- cms/envs/common.py | 1 + cms/envs/devstack.py | 53 +++++++++++++++++++++++++++++++++++++++++++ lms/envs/common.py | 1 + lms/envs/devstack.py | 54 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 109 insertions(+) create mode 100644 cms/envs/devstack.py create mode 100644 lms/envs/devstack.py diff --git a/cms/envs/common.py b/cms/envs/common.py index 5d72556e52..7a75623949 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -136,6 +136,7 @@ XQUEUE_INTERFACE = { STATICFILES_FINDERS = ( 'staticfiles.finders.FileSystemFinder', 'staticfiles.finders.AppDirectoriesFinder', + 'pipeline.finders.PipelineFinder', ) # List of callables that know how to import templates from various sources. diff --git a/cms/envs/devstack.py b/cms/envs/devstack.py new file mode 100644 index 0000000000..d030683634 --- /dev/null +++ b/cms/envs/devstack.py @@ -0,0 +1,53 @@ +""" +Specific overrides to the base prod settings to make development easier. +""" + +from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import + +DEBUG = True +USE_I18N = True +TEMPLATE_DEBUG = DEBUG + +################################ EMAIL ######################################## + +EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' + +################################# LMS INTEGRATION ###################################### + +MITX_FEATURES['PREVIEW_LMS_BASE'] = "preview.localhost:8000" + +################################# CELERY ###################################### + +# By default don't use a worker, execute tasks as if they were local functions +CELERY_ALWAYS_EAGER = True + +################################ DEBUG TOOLBAR ################################# +INSTALLED_APPS += ('debug_toolbar', 'debug_toolbar_mongo') +MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',) +INTERNAL_IPS = ('127.0.0.1',) + +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.sql.SQLDebugPanel', + 'debug_toolbar.panels.signals.SignalDebugPanel', + 'debug_toolbar.panels.logger.LoggingPanel', +) + +DEBUG_TOOLBAR_CONFIG = { + 'INTERCEPT_REDIRECTS': False +} + +# To see stacktraces for MongoDB queries, set this to True. +# Stacktraces slow down page loads drastically (for pages with lots of queries). +DEBUG_TOOLBAR_MONGO_STACKTRACES = False + +##################################################################### +# Lastly, see if the developer has any local overrides. +try: + from .private import * # pylint: disable=F0401 +except ImportError: + pass diff --git a/lms/envs/common.py b/lms/envs/common.py index 8420e53ab1..5360dff55b 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -573,6 +573,7 @@ WAFFLE_MAX_AGE = 1209600 STATICFILES_FINDERS = ( 'staticfiles.finders.FileSystemFinder', 'staticfiles.finders.AppDirectoriesFinder', + 'pipeline.finders.PipelineFinder', ) # List of callables that know how to import templates from various sources. diff --git a/lms/envs/devstack.py b/lms/envs/devstack.py new file mode 100644 index 0000000000..84ce008285 --- /dev/null +++ b/lms/envs/devstack.py @@ -0,0 +1,54 @@ +""" +Specific overrides to the base prod settings to make development easier. +""" + +from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import + +DEBUG = True +USE_I18N = True +TEMPLATE_DEBUG = True + +# By default don't use a worker, execute tasks as if they were local functions +CELERY_ALWAYS_EAGER = True + + +################################ EMAIL ######################################## + +EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' +MITX_FEATURES['ENABLE_INSTRUCTOR_EMAIL'] = True # Enable email for all Studio courses +MITX_FEATURES['REQUIRE_COURSE_EMAIL_AUTH'] = False # Give all courses email (don't require django-admin perms) + + +################################ DEBUG TOOLBAR ################################ + +INSTALLED_APPS += ('debug_toolbar',) +MIDDLEWARE_CLASSES += ('django_comment_client.utils.QueryCountDebugMiddleware', + 'debug_toolbar.middleware.DebugToolbarMiddleware',) +INTERNAL_IPS = ('127.0.0.1',) + +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.sql.SQLDebugPanel', + 'debug_toolbar.panels.signals.SignalDebugPanel', + 'debug_toolbar.panels.logger.LoggingPanel', +) + +DEBUG_TOOLBAR_CONFIG = { + 'INTERCEPT_REDIRECTS': False +} + +########################### PIPELINE ################################# + +PIPELINE_SASS_ARGUMENTS = '--debug-info --require {proj_dir}/static/sass/bourbon/lib/bourbon.rb'.format(proj_dir=PROJECT_ROOT) + + +##################################################################### +# Lastly, see if the developer has any local overrides. +try: + from .private import * # pylint: disable=F0401 +except ImportError: + pass