devstack.py 9.88 KB
Newer Older
Will Daly committed
1 2 3
"""
Specific overrides to the base prod settings to make development easier.
"""
4
from os.path import abspath, dirname, join
Will Daly committed
5

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

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


Will Daly committed
13 14
DEBUG = True
USE_I18N = True
15
DEFAULT_TEMPLATE_ENGINE['OPTIONS']['debug'] = True
16
SITE_NAME = 'localhost:8000'
17
PLATFORM_NAME = ENV_TOKENS.get('PLATFORM_NAME', 'Devstack')
Will Daly committed
18 19
# By default don't use a worker, execute tasks as if they were local functions
CELERY_ALWAYS_EAGER = True
20
HTTPS = 'off'
Will Daly committed
21

22
LMS_ROOT_URL = 'http://localhost:8000'
23
ENTERPRISE_API_URL = LMS_ROOT_URL + '/enterprise/api/v1/'
24

25 26
################################ LOGGERS ######################################

27
# Silence noisy logs
28
import logging
29 30 31 32 33 34 35 36
LOG_OVERRIDES = [
    ('track.contexts', logging.CRITICAL),
    ('track.middleware', logging.CRITICAL),
    ('dd.dogapi', logging.CRITICAL),
    ('django_comment_client.utils', logging.CRITICAL),
]
for log_name, log_level in LOG_OVERRIDES:
    logging.getLogger(log_name).setLevel(log_level)
37

Will Daly committed
38 39 40 41 42

################################ EMAIL ########################################

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

43 44 45 46 47
########################## ANALYTICS TESTING ########################

ANALYTICS_SERVER_URL = "http://127.0.0.1:9000/"
ANALYTICS_API_KEY = ""

48 49 50 51
# Set this to the dashboard URL in order to display the link from the
# dashboard to the Analytics Dashboard.
ANALYTICS_DASHBOARD_URL = None

52 53 54 55 56 57 58 59
############################ PYFS XBLOCKS SERVICE #############################
# Set configuration for Django pyfilesystem

DJFS = {
    'type': 'osfs',
    'directory_root': 'lms/static/djpyfs',
    'url_root': '/static/djpyfs',
}
60

Will Daly committed
61 62
################################ DEBUG TOOLBAR ################################

63
INSTALLED_APPS += ('debug_toolbar', 'debug_toolbar_mongo')
64 65 66
MIDDLEWARE_CLASSES += (
    'django_comment_client.utils.QueryCountDebugMiddleware',
    'debug_toolbar.middleware.DebugToolbarMiddleware',
67
)
Will Daly committed
68 69 70
INTERNAL_IPS = ('127.0.0.1',)

DEBUG_TOOLBAR_PANELS = (
71 72 73 74 75 76 77 78
    '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',
79
    'debug_toolbar_mongo.panel.MongoDebugPanel',
80 81 82 83
    # ProfilingPanel has been intentionally removed for default devstack.py
    # runtimes for performance reasons. If you wish to re-enable it in your
    # local development environment, please create a new settings file
    # that imports and extends devstack.py.
Will Daly committed
84 85 86
)

DEBUG_TOOLBAR_CONFIG = {
87
    'SHOW_TOOLBAR_CALLBACK': 'lms.envs.devstack.should_show_debug_toolbar'
Will Daly committed
88 89
}

90 91 92 93 94

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


Will Daly committed
95 96
########################### PIPELINE #################################

97
PIPELINE_ENABLED = False
98
STATICFILES_STORAGE = 'openedx.core.storage.DevelopmentStorage'
99 100 101

# Revert to the default set of finders as we don't want the production pipeline
STATICFILES_FINDERS = [
102
    'openedx.core.djangoapps.theming.finders.ThemeFilesFinder',
103 104
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
105 106 107 108
]

# Disable JavaScript compression in development
PIPELINE_JS_COMPRESSOR = None
109 110 111 112

# Whether to run django-require in debug mode.
REQUIRE_DEBUG = DEBUG

113
PIPELINE_SASS_ARGUMENTS = '--debug-info'
Will Daly committed
114

115 116 117 118
########################### VERIFIED CERTIFICATES #################################

FEATURES['AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING'] = True
FEATURES['ENABLE_PAYMENT_FAKE'] = True
119

120 121 122 123 124 125 126 127 128
CC_PROCESSOR_NAME = 'CyberSource2'
CC_PROCESSOR = {
    'CyberSource2': {
        "PURCHASE_ENDPOINT": '/shoppingcart/payment_fake/',
        "SECRET_KEY": 'abcd123',
        "ACCESS_KEY": 'abcd123',
        "PROFILE_ID": 'edx',
    }
}
Will Daly committed
129

130
########################### External REST APIs #################################
131 132
FEATURES['ENABLE_OAUTH2_PROVIDER'] = True
OAUTH_OIDC_ISSUER = 'http://127.0.0.1:8000/oauth2'
133 134 135
FEATURES['ENABLE_MOBILE_REST_API'] = True
FEATURES['ENABLE_VIDEO_ABSTRACTION_LAYER_API'] = True

136 137 138 139 140 141 142 143 144
########################## SECURITY #######################
FEATURES['ENFORCE_PASSWORD_POLICY'] = False
FEATURES['ENABLE_MAX_FAILED_LOGIN_ATTEMPTS'] = False
FEATURES['SQUELCH_PII_IN_LOGS'] = False
FEATURES['PREVENT_CONCURRENT_LOGINS'] = False
FEATURES['ADVANCED_SECURITY'] = False
PASSWORD_MIN_LENGTH = None
PASSWORD_COMPLEXITY = {}

145 146 147 148

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

149 150
########################### Milestones #################################
FEATURES['ORGANIZATIONS_APP'] = True
151 152 153 154

########################### Entrance Exams #################################
FEATURES['ENTRANCE_EXAMS'] = True

155 156 157
################################ COURSE LICENSES ################################
FEATURES['LICENSING'] = True

158

159
########################## Courseware Search #######################
160
FEATURES['ENABLE_COURSEWARE_SEARCH'] = True
161 162 163
SEARCH_ENGINE = "search.elastic.ElasticSearchEngine"


164 165 166 167
########################## Dashboard Search #######################
FEATURES['ENABLE_DASHBOARD_SEARCH'] = True


168 169 170 171
########################## Certificates Web/HTML View #######################
FEATURES['CERTIFICATES_HTML_VIEW'] = True


172
########################## Course Discovery #######################
173
LANGUAGE_MAP = {'terms': {lang: display for lang, display in ALL_LANGUAGES}, 'name': 'Language'}
174 175
COURSE_DISCOVERY_MEANINGS = {
    'org': {
176
        'name': 'Organization',
177 178
    },
    'modes': {
179
        'name': 'Course Type',
180
        'terms': {
181 182
            'honor': 'Honor',
            'verified': 'Verified',
183 184 185 186 187
        },
    },
    'language': LANGUAGE_MAP,
}

188 189 190
FEATURES['ENABLE_COURSE_DISCOVERY'] = True
# Setting for overriding default filtering facets for Course discovery
# COURSE_DISCOVERY_FILTERS = ["org", "language", "modes"]
191 192
FEATURES['COURSES_ARE_BROWSEABLE'] = True
HOMEPAGE_COURSE_MAX = 9
193 194 195 196 197 198 199 200 201

# Software secure fake page feature flag
FEATURES['ENABLE_SOFTWARE_SECURE_FAKE'] = True

# Setting for the testing of Software Secure Result Callback
VERIFY_STUDENT["SOFTWARE_SECURE"] = {
    "API_ACCESS_KEY": "BBBBBBBBBBBBBBBBBBBB",
    "API_SECRET_KEY": "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC",
}
202
DISABLE_ACCOUNT_ACTIVATION_REQUIREMENT_SWITCH = "verify_student_disable_account_activation_requirement"
203

204 205 206
# Skip enrollment start date filtering
SEARCH_SKIP_ENROLLMENT_START_DATE_FILTERING = True

207 208 209 210 211 212 213

########################## Shopping cart ##########################
FEATURES['ENABLE_SHOPPING_CART'] = True
FEATURES['STORE_BILLING_INFO'] = True
FEATURES['ENABLE_PAID_COURSE_REGISTRATION'] = True
FEATURES['ENABLE_COSMETIC_DISPLAY_PRICE'] = True

214 215 216 217
########################## Third Party Auth #######################

if FEATURES.get('ENABLE_THIRD_PARTY_AUTH') and 'third_party_auth.dummy.DummyBackend' not in AUTHENTICATION_BACKENDS:
    AUTHENTICATION_BACKENDS = ['third_party_auth.dummy.DummyBackend'] + list(AUTHENTICATION_BACKENDS)
218

219 220 221
############## ECOMMERCE API CONFIGURATION SETTINGS ###############
ECOMMERCE_PUBLIC_URL_ROOT = "http://localhost:8002"

222 223 224
CREDENTIALS_INTERNAL_SERVICE_URL = 'http://localhost:8008'
CREDENTIALS_PUBLIC_SERVICE_URL = 'http://localhost:8008'

225 226 227 228 229 230
###################### Cross-domain requests ######################
FEATURES['ENABLE_CORS_HEADERS'] = True
CORS_ALLOW_CREDENTIALS = True
CORS_ORIGIN_WHITELIST = ()
CORS_ORIGIN_ALLOW_ALL = True

Ahsan Ulhaq committed
231
# JWT settings for devstack
232
JWT_PRIVATE_SIGNING_KEY = """\
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261
-----BEGIN PRIVATE KEY-----
MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCkK6N/mhkEYrgx
p8xEZj37N1FEj1gObWv7zVygMLKxKvCSFOQUjA/Z2ZLqVi8m5DnCJ+5BrdYW/UqH
02vZdEnWb04vf8mmYzJOL9i7APu0h/rm1pvVI5JFiSjE4pG669m5dAb2dZtesYOd
yfC5bF97KbBZoisCEAtRLn6cNrt1q6PxWeCxZq4ysQD8xZKETOxHnfAYqVyIRkDW
v8B9DnldLjYa8GhuGHL1J5ncHoseJoATLCnAWYo+yy6gdI2Fs9rj0tbeBcnoKwUZ
ENwEUp3En+Xw7zjtDuSDWW9ySkuwrK7nXrs0r1CPVf87dLBUEvdzHHUelDr6rdIY
tnieCjCHAgMBAAECggEBAJvTiAdQPzq4cVlAilTKLz7KTOsknFJlbj+9t5OdZZ9g
wKQIDE2sfEcti5O+Zlcl/eTaff39gN6lYR73gMEQ7h0J3U6cnsy+DzvDkpY94qyC
/ZYqUhPHBcnW3Mm0vNqNj0XGae15yBXjrKgSy9lUknSXJ3qMwQHeNL/DwA2KrfiL
g0iVjk32dvSSHWcBh0M+Qy1WyZU0cf9VWzx+Q1YLj9eUCHteStVubB610XV3JUZt
UTWiUCffpo2okHsTBuKPVXK/5BL+BpGplcxRSlnSbMaI611kN3iKlO8KGIS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JWT_AUDIENCE': 'lms-key',
})
267

268 269
#####################################################################
# See if the developer has any local overrides.
270 271
if os.path.isfile(join(dirname(abspath(__file__)), 'private.py')):
    from .private import *  # pylint: disable=import-error,wildcard-import
272 273 274 275 276 277

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

SECRET_KEY = '85920908f28904ed733fe576320db18cabd7b6cd'