devstack.py 3.24 KB
Newer Older
Will Daly committed
1 2 3 4
"""
Specific overrides to the base prod settings to make development easier.
"""

5
from .aws import *  # pylint: disable=wildcard-import, unused-wildcard-import
Will Daly committed
6

7 8
# Don't use S3 in devstack, fall back to filesystem
del DEFAULT_FILE_STORAGE
9
MEDIA_ROOT = "/edx/var/edxapp/uploads"
10

Will Daly committed
11 12 13 14
DEBUG = True
USE_I18N = True
TEMPLATE_DEBUG = DEBUG

15 16 17 18 19 20 21 22 23
################################ LOGGERS ######################################

import logging

# Disable noisy loggers
for pkg_name in ['track.contexts', 'track.middleware', 'dd.dogapi']:
    logging.getLogger(pkg_name).setLevel(logging.CRITICAL)


Will Daly committed
24 25 26 27
################################ EMAIL ########################################

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

28
################################# LMS INTEGRATION #############################
Will Daly committed
29

30
LMS_BASE = "localhost:8000"
31
FEATURES['PREVIEW_LMS_BASE'] = "preview." + LMS_BASE
Will Daly committed
32

33 34 35 36 37
############################# ADVANCED COMPONENTS #############################

# Make it easier to test advanced components in local dev
FEATURES['ALLOW_ALL_ADVANCED_COMPONENTS'] = True

Will Daly committed
38 39 40 41 42
################################# CELERY ######################################

# By default don't use a worker, execute tasks as if they were local functions
CELERY_ALWAYS_EAGER = True

43
################################ DEBUG TOOLBAR ################################
Will Daly committed
44 45 46 47 48
INSTALLED_APPS += ('debug_toolbar', 'debug_toolbar_mongo')
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
INTERNAL_IPS = ('127.0.0.1',)

DEBUG_TOOLBAR_PANELS = (
49 50 51 52 53 54 55 56 57
    '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.signals.SignalsPanel',
    'debug_toolbar.panels.logging.LoggingPanel',
    'debug_toolbar.panels.profiling.ProfilingPanel',
Will Daly committed
58 59 60
)

DEBUG_TOOLBAR_CONFIG = {
61
    'SHOW_TOOLBAR_CALLBACK': 'cms.envs.devstack.should_show_debug_toolbar'
Will Daly committed
62 63
}

64 65 66 67 68

def should_show_debug_toolbar(_):
    return True  # We always want the toolbar on devstack regardless of IP, auth, etc.


Will Daly committed
69 70 71 72
# 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

73 74 75 76 77 78 79 80

################################ MILESTONES ################################
FEATURES['MILESTONES_APP'] = True


################################ ENTRANCE EXAMS ################################
FEATURES['ENTRANCE_EXAMS'] = True

81 82
################################ SEARCH INDEX ################################
FEATURES['ENABLE_COURSEWARE_INDEX'] = True
83
FEATURES['ENABLE_LIBRARY_INDEX'] = True
84
SEARCH_ENGINE = "search.elastic.ElasticSearchEngine"
85

86
###############################################################################
87
# See if the developer has any local overrides.
Will Daly committed
88
try:
89
    from .private import *  # pylint: disable=import-error
Will Daly committed
90 91
except ImportError:
    pass
92 93 94 95

#####################################################################
# Lastly, run any migrations, if needed.
MODULESTORE = convert_module_store_setting_if_needed(MODULESTORE)
96 97 98

# Dummy secret key for dev
SECRET_KEY = '85920908f28904ed733fe576320db18cabd7b6cd'