common.py 81.7 KB
Newer Older
1
# -*- coding: utf-8 -*-
2 3 4 5
"""
This is the common settings file, intended to set sane defaults. If you have a
piece of configuration that's dependent on a set of feature flags being set,
then create a function that returns the calculated value based on the value of
6
FEATURES[...]. Modules that extend this one can change the feature
7 8 9
configuration in an environment specific config file and re-calculate those
values.

10
We should make a method that calls all these config methods so that you just
11
make one call at the end of your site-specific dev file to reset all the
12 13
dependent variables (like INSTALLED_APPS) for you.

14
Longer TODO:
15
1. Right now our treatment of static content in general and in particular
16 17
   course-specific static content is haphazard.
2. We should have a more disciplined approach to feature flagging, even if it
18
   just means that we stick them in a dict called FEATURES.
19
3. We need to handle configuration for multiple courses. This could be as
20 21
   multiple sites, but we do need a way to map their data assets.
"""
22 23 24

# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
25
# pylint: disable=wildcard-import, unused-import, unused-wildcard-import, invalid-name
26

27 28 29 30 31
# Pylint gets confused by path.py instances, which report themselves as class
# objects. As a result, pylint applies the wrong regex in validating names,
# and throws spurious errors. Therefore, we disable invalid-name checking.
# pylint: disable=invalid-name

32
import sys
33
import os
34
import imp
35

36
from path import path
37
from warnings import simplefilter
38
from django.utils.translation import ugettext_lazy as _
39

40
from .discussionsettings import *
41
import dealer.git
42
from xmodule.modulestore.modulestore_settings import update_module_store_settings
43
from xmodule.mixin import LicenseMixin
44
from lms.djangoapps.lms_xblock.mixin import LmsBlockMixin
Calen Pennington committed
45

46
################################### FEATURES ###################################
47
# The display name of the platform to be used in templates/emails/etc.
48
PLATFORM_NAME = "Your Platform Name Here"
49
CC_MERCHANT_NAME = PLATFORM_NAME
50 51
# Shows up in the platform footer, eg "(c) COPYRIGHT_YEAR"
COPYRIGHT_YEAR = "2015"
52

53
PLATFORM_FACEBOOK_ACCOUNT = "http://www.facebook.com/YourPlatformFacebookAccount"
54
PLATFORM_TWITTER_ACCOUNT = "@YourPlatformTwitterAccount"
55

56
COURSEWARE_ENABLED = True
57
ENABLE_JASMINE = False
58

Arjun Singh committed
59 60 61 62
DISCUSSION_SETTINGS = {
    'MAX_COMMENT_DEPTH': 2,
}

63

64
# Features
65
FEATURES = {
Calen Pennington committed
66
    'USE_DJANGO_PIPELINE': True,
67 68

    'DISPLAY_DEBUG_INFO_TO_STAFF': True,
69
    'DISPLAY_HISTOGRAMS_TO_STAFF': False,  # For large courses this slows down courseware access for staff.
70

71 72
    'REROUTE_ACTIVATION_EMAIL': False,  # nonempty string = address for all activation emails
    'DEBUG_LEVEL': 0,  # 0 = lowest level, least verbose, 255 = max level, most verbose
73 74 75

    ## DO NOT SET TO True IN THIS FILE
    ## Doing so will cause all courses to be released on production
76
    'DISABLE_START_DATES': False,  # When True, all courses will be active, regardless of start date
77

78
    # When True, will only publicly list courses by the subdomain.
Calen Pennington committed
79
    'SUBDOMAIN_COURSE_LISTINGS': False,
80 81 82 83 84 85 86 87 88 89 90 91 92 93
    # Expects you to define COURSE_LISTINGS, a dictionary mapping
    # subdomains to lists of course_ids
    # COURSE_LISTINGS = {
    #     'default': [
    #         'BerkeleyX/CS169.1x/2012_Fall',
    #         'HarvardX/CS50x/2012',
    #         'MITx/3.091x/2012_Fall',
    #     ],
    #     'openedx': [
    #         'BerkeleyX/CS169.1x/2012_Fall',
    #     ],
    # }
    # To see it in action, add the following to your /etc/hosts file:
    #     127.0.0.1 openedx.dev
94

95 96 97 98 99
    # When True, will override certain branding with university specific values
    # Expects a SUBDOMAIN_BRANDING dictionary that maps the subdomain to the
    # university to use for branding purposes
    'SUBDOMAIN_BRANDING': False,

100
    'FORCE_UNIVERSITY_DOMAIN': False,  # set this to the university domain to use, as an override to HTTP_HOST
101
                                       # set to None to do no university selection
102

103 104
    # for consistency in user-experience, keep the value of the following 3 settings
    # in sync with the corresponding ones in cms/envs/common.py
105
    'ENABLE_DISCUSSION_SERVICE': True,
106 107
    'ENABLE_TEXTBOOK': True,
    'ENABLE_STUDENT_NOTES': True,  # enables the student notes API and UI.
108

109
    # discussion home panel, which includes a subscription on/off setting for discussion digest emails.
110
    # this should remain off in production until digest notifications are online.
e0d committed
111
    'ENABLE_DISCUSSION_HOME_PANEL': False,
112

113 114 115 116 117 118 119
    # Set this to True if you want the discussion digest emails enabled automatically for new users.
    # This will be set on all new account registrations.
    # It is not recommended to enable this feature if ENABLE_DISCUSSION_HOME_PANEL is not enabled, since
    # subscribers who receive digests in that case will only be able to unsubscribe via links embedded
    # in their emails, and they will have no way to resubscribe.
    'ENABLE_DISCUSSION_EMAIL_DIGEST': False,

120
    'ENABLE_PSYCHOMETRICS': False,  # real-time psychometrics (eg item response theory analysis in instructor dashboard)
121

122
    'ENABLE_DJANGO_ADMIN_SITE': True,  # set true to enable django's admin site, even on prod (e.g. for course ops)
123 124
    'ENABLE_SQL_TRACKING_LOGS': False,
    'ENABLE_LMS_MIGRATION': False,
125
    'ENABLE_MANUAL_GIT_RELOAD': False,
126

127 128
    'ENABLE_MASQUERADE': True,  # allow course staff to change to student view of courseware

Carson Gee committed
129 130
    'ENABLE_SYSADMIN_DASHBOARD': False,  # sysadmin dashboard, to see what courses are loaded, to delete & load courses

131
    'DISABLE_LOGIN_BUTTON': False,  # used in systems where login is automatic, eg MIT SSL
132

133 134 135
    # extrernal access methods
    'ACCESS_REQUIRE_STAFF_FOR_COURSE': False,
    'AUTH_USE_OPENID': False,
136
    'AUTH_USE_CERTIFICATES': False,
137
    'AUTH_USE_OPENID_PROVIDER': False,
138 139
    # Even though external_auth is in common, shib assumes the LMS views / urls, so it should only be enabled
    # in LMS
140
    'AUTH_USE_SHIB': False,
141
    'AUTH_USE_CAS': False,
142 143 144 145

    # This flag disables the requirement of having to agree to the TOS for users registering
    # with Shib.  Feature was requested by Stanford's office of general counsel
    'SHIB_DISABLE_TOS': False,
146

147 148 149
    # Toggles OAuth2 authentication provider
    'ENABLE_OAUTH2_PROVIDER': False,

150 151 152 153 154 155 156
    # Allows to enable an API endpoint to serve XBlock view, used for example by external applications.
    # See jquey-xblock: https://github.com/edx-solutions/jquery-xblock
    'ENABLE_XBLOCK_VIEW_ENDPOINT': False,

    # Allows to configure the LMS to provide CORS headers to serve requests from other domains
    'ENABLE_CORS_HEADERS': False,

157 158
    # Can be turned off if course lists need to be hidden. Effects views and templates.
    'COURSES_ARE_BROWSABLE': True,
159

160 161
    # Enables ability to restrict enrollment in specific courses by the user account login method
    'RESTRICT_ENROLL_BY_REG_METHOD': False,
162

163 164 165 166
    # Enables the LMS bulk email feature for course staff
    'ENABLE_INSTRUCTOR_EMAIL': True,
    # If True and ENABLE_INSTRUCTOR_EMAIL: Forces email to be explicitly turned on
    #   for each course via django-admin interface.
167 168
    # If False and ENABLE_INSTRUCTOR_EMAIL: Email will be turned on by default
    #   for all Mongo-backed courses.
169
    'REQUIRE_COURSE_EMAIL_AUTH': True,
170

171 172 173 174
    # Analytics experiments - shows instructor analytics tab in LMS instructor dashboard.
    # Enabling this feature depends on installation of a separate analytics server.
    'ENABLE_INSTRUCTOR_ANALYTICS': False,

175
    # enable analytics server.
176 177
    # WARNING: THIS SHOULD ALWAYS BE SET TO FALSE UNDER NORMAL
    # LMS OPERATION. See analytics.py for details about what
178 179
    # this does.
    'RUN_AS_ANALYTICS_SERVER_ENABLED': False,
180

181 182
    # Flip to True when the YouTube iframe API breaks (again)
    'USE_YOUTUBE_OBJECT_API': False,
183

184
    # Give a UI to show a student's submission history in a problem by the
185
    # Staff Debug tool.
186 187
    'ENABLE_STUDENT_HISTORY_VIEW': True,

188
    # Segment.io for LMS--need to explicitly turn it on for production.
189 190
    'SEGMENT_IO_LMS': False,

191
    # Provide a UI to allow users to submit feedback from the LMS (left-hand help modal)
192
    'ENABLE_FEEDBACK_SUBMISSION': False,
Ned Batchelder committed
193

194 195 196
    # Turn on a page that lets staff enter Python code to be run in the
    # sandbox, for testing whether it's enabled properly.
    'ENABLE_DEBUG_RUN_PYTHON': False,
197 198 199

    # Enable URL that shows information about the status of variuous services
    'ENABLE_SERVICE_STATUS': False,
200 201

    # Toggle to indicate use of a custom theme
202 203
    'USE_CUSTOM_THEME': False,

204 205
    # Don't autoplay videos for students
    'AUTOPLAY_VIDEOS': False,
206

207 208
    # Enable instructor dash to submit background tasks
    'ENABLE_INSTRUCTOR_BACKGROUND_TASKS': True,
209

210
    # Enable instructor to assign individual due dates
211 212 213 214
    # Note: In order for this feature to work, you must also add
    # 'courseware.student_field_overrides.IndividualStudentOverrideProvider' to
    # the setting FIELD_OVERRIDE_PROVIDERS, in addition to setting this flag to
    # True.
215 216
    'INDIVIDUAL_DUE_DATES': False,

cewing committed
217 218
    # Enable Custom Courses for EdX
    'CUSTOM_COURSES_EDX': False,
219

220 221
    # Enable legacy instructor dashboard
    'ENABLE_INSTRUCTOR_LEGACY_DASHBOARD': True,
222 223

    # Is this an edX-owned domain? (used for edX specific messaging and images)
224
    'IS_EDX_DOMAIN': False,
225

226 227 228
    # Toggle to enable certificates of courses on dashboard
    'ENABLE_VERIFIED_CERTIFICATES': False,

229 230
    # Allow use of the hint managment instructor view.
    'ENABLE_HINTER_INSTRUCTOR_VIEW': False,
231

232
    # for load testing
233
    'AUTOMATIC_AUTH_FOR_TESTING': False,
234

235 236
    # Toggle to enable chat availability (configured on a per-course
    # basis in Studio)
237
    'ENABLE_CHAT': False,
238 239

    # Allow users to enroll with methods other than just honor code certificates
240
    'MULTIPLE_ENROLLMENT_ROLES': False,
241

242
    # Toggle the availability of the shopping cart page
David Ormsbee committed
243
    'ENABLE_SHOPPING_CART': False,
244 245

    # Toggle storing detailed billing information
246
    'STORE_BILLING_INFO': False,
247 248 249

    # Enable flow for payments for course registration (DIFFERENT from verified student flow)
    'ENABLE_PAID_COURSE_REGISTRATION': False,
250

251 252 253
    # Enable the display of cosmetic course price display (set in course advanced settings)
    'ENABLE_COSMETIC_DISPLAY_PRICE': False,

254 255
    # Automatically approve student identity verification attempts
    'AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING': False,
256 257 258 259

    # Disable instructor dash buttons for downloading course data
    # when enrollment exceeds this number
    'MAX_ENROLLMENT_INSTR_BUTTONS': 200,
260 261 262

    # Grade calculation started from the new instructor dashboard will write
    # grades CSV files to S3 and give links for downloads.
263 264
    'ENABLE_S3_GRADE_DOWNLOADS': False,

265
    # whether to use password policy enforcement or not
266
    'ENFORCE_PASSWORD_POLICY': True,
267

268 269
    # Give course staff unrestricted access to grade downloads (if set to False,
    # only edX superusers can perform the downloads)
270
    'ALLOW_COURSE_STAFF_GRADE_DOWNLOADS': False,
Julia Hansbrough committed
271

272 273 274 275 276 277
    'ENABLED_PAYMENT_REPORTS': [
        "refund_report",
        "itemized_purchase_report",
        "university_revenue_share",
        "certificate_status"
    ],
278 279

    # Turn off account locking if failed login attempts exceeds a limit
280
    'ENABLE_MAX_FAILED_LOGIN_ATTEMPTS': True,
281 282

    # Hide any Personally Identifiable Information from application logs
283
    'SQUELCH_PII_IN_LOGS': True,
284

285 286
    # Toggles the embargo functionality, which blocks users from
    # the site or courses based on their location.
287
    'EMBARGO': False,
288 289 290 291 292

    # Whether the Wiki subsystem should be accessible via the direct /wiki/ paths. Setting this to True means
    # that people can submit content and modify the Wiki in any arbitrary manner. We're leaving this as True in the
    # defaults, so that we maintain current behavior
    'ALLOW_WIKI_ROOT_ACCESS': True,
293 294 295

    # Turn on/off Microsites feature
    'USE_MICROSITES': False,
296 297 298 299

    # Turn on third-party auth. Disabled for now because full implementations are not yet available. Remember to syncdb
    # if you enable this; we don't create tables by default.
    'ENABLE_THIRD_PARTY_AUTH': False,
300 301 302

    # Toggle to enable alternate urls for marketing links
    'ENABLE_MKTG_SITE': False,
303 304

    # Prevent concurrent logins per user
305
    'PREVENT_CONCURRENT_LOGINS': True,
306

307 308
    # Turn on Advanced Security by default
    'ADVANCED_SECURITY': True,
309

310 311 312 313 314
    # When a logged in user goes to the homepage ('/') should the user be
    # redirected to the dashboard - this is default Open edX behavior. Set to
    # False to not redirect the user
    'ALWAYS_REDIRECT_HOMEPAGE_TO_DASHBOARD_FOR_AUTHENTICATED_USER': True,

315 316 317
    # When a user goes to the homepage ('/') the user see the
    # courses listed in the announcement dates order - this is default Open edX behavior.
    # Set to True to change the course sorting behavior by their start dates, latest first.
318
    'ENABLE_COURSE_SORTING_BY_START_DATE': True,
319

320
    # Expose Mobile REST API. Note that if you use this, you must also set
321 322
    # ENABLE_OAUTH2_PROVIDER to True
    'ENABLE_MOBILE_REST_API': False,
323
    'ENABLE_MOBILE_SOCIAL_FACEBOOK_FEATURES': False,
324
    'ENABLE_RENDER_XBLOCK_API': False,
325

326 327 328
    # Enable the combined login/registration form
    'ENABLE_COMBINED_LOGIN_REGISTRATION': False,

329 330 331
    # Enable organizational email opt-in
    'ENABLE_MKTG_EMAIL_OPT_IN': False,

asadiqbal08 committed
332 333 334 335
    # Show a section in the membership tab of the instructor dashboard
    # to allow an upload of a CSV file that contains a list of new accounts to create
    # and register for course.
    'ALLOW_AUTOMATED_SIGNUPS': False,
336 337

    # Display demographic data on the analytics tab in the instructor dashboard.
338 339 340 341
    'DISPLAY_ANALYTICS_DEMOGRAPHICS': True,

    # Enable display of enrollment counts in instructor and legacy analytics dashboard
    'DISPLAY_ANALYTICS_ENROLLMENTS': True,
342

343 344
    # Show the mobile app links in the footer
    'ENABLE_FOOTER_MOBILE_APP_LINKS': False,
345

346
    # Let students save and manage their annotations
347
    'ENABLE_EDXNOTES': False,
348 349 350 351 352 353

    # Milestones application flag
    'MILESTONES_APP': False,

    # Prerequisite courses feature flag
    'ENABLE_PREREQUISITE_COURSES': False,
354 355 356

    # For easily adding modes to courses during acceptance testing
    'MODE_CREATION_FOR_TESTING': False,
357 358 359

    # Courseware search feature
    'ENABLE_COURSEWARE_SEARCH': False,
360

361 362 363
    # Dashboard search feature
    'ENABLE_DASHBOARD_SEARCH': False,

364 365
    # log all information from cybersource callbacks
    'LOG_POSTPAY_CALLBACKS': True,
366 367 368

    # enable beacons for video timing statistics
    'ENABLE_VIDEO_BEACON': False,
369

370 371 372
    # enable beacons for lms onload event statistics
    'ENABLE_ONLOAD_BEACON': False,

373 374 375
    # Toggle platform-wide course licensing
    'LICENSING': False,

376 377
    # Certificates Web/HTML Views
    'CERTIFICATES_HTML_VIEW': False,
378 379 380

    # Social Media Sharing on Student Dashboard
    'DASHBOARD_SHARE_SETTINGS': {
381 382
        # Note: Ensure 'CUSTOM_COURSE_URLS' has a matching value in cms/envs/common.py
        'CUSTOM_COURSE_URLS': False,
383 384 385 386
        'FACEBOOK_SHARING': False,
        'TWITTER_SHARING': False,
        'TWITTER_SHARING_TEXT': None
    },
387 388 389

    # Course discovery feature
    'ENABLE_COURSE_DISCOVERY': False,
390 391 392

    # Software secure fake page feature flag
    'ENABLE_SOFTWARE_SECURE_FAKE': False,
393 394 395

    # Teams feature
    'ENABLE_TEAMS': False,
Alexander Kryklia committed
396 397 398 399 400 401 402

    # Show video bumper in LMS
    'ENABLE_VIDEO_BUMPER': False,

    # How many seconds to show the bumper again, default is 7 days:
    'SHOW_BUMPER_PERIODICITY': 7 * 24 * 3600,

403 404 405
    # Enable OpenBadge support. See the BADGR_* settings later in this file.
    'ENABLE_OPENBADGES': False,

406 407
}

408 409 410
# Ignore static asset files on import which match this pattern
ASSET_IGNORE_REGEX = r"(^\._.*$)|(^\.DS_Store$)|(^.*~$)"

411 412 413 414 415 416
# Used for A/B testing
DEFAULT_GROUPS = []

# If this is true, random scores will be generated for the purpose of debugging the profile graphs
GENERATE_PROFILE_SCORES = False

417
# Used with XQueue
418
XQUEUE_WAITTIME_BETWEEN_REQUESTS = 5  # seconds
419

420

421
############################# SET PATH INFORMATION #############################
422
PROJECT_ROOT = path(__file__).abspath().dirname().dirname()  # /edx-platform/lms
423 424
REPO_ROOT = PROJECT_ROOT.dirname()
COMMON_ROOT = REPO_ROOT / "common"
425
ENV_ROOT = REPO_ROOT.dirname()  # virtualenv dir /edx-platform is in
426 427 428 429
COURSES_ROOT = ENV_ROOT / "data"

DATA_DIR = COURSES_ROOT

430
# TODO: Remove the rest of the sys.path modification here and in cms/envs/common.py
431
sys.path.append(REPO_ROOT)
432
sys.path.append(PROJECT_ROOT / 'djangoapps')
433
sys.path.append(COMMON_ROOT / 'djangoapps')
434

435
# For Node.js
436

437
system_node_path = os.environ.get("NODE_PATH", REPO_ROOT / 'node_modules')
438

439 440 441 442 443
node_paths = [
    COMMON_ROOT / "static/js/vendor",
    COMMON_ROOT / "static/coffee/src",
    system_node_path,
]
444
NODE_PATH = ':'.join(node_paths)
445

446 447
# For geolocation ip database
GEOIP_PATH = REPO_ROOT / "common/static/data/geoip/GeoIP.dat"
448
GEOIPV6_PATH = REPO_ROOT / "common/static/data/geoip/GeoIPv6.dat"
449

450
# Where to look for a status message
451
STATUS_MESSAGE_PATH = ENV_ROOT / "status_message.json"
452

453
############################ OpenID Provider  ##################################
454
OPENID_PROVIDER_TRUSTED_ROOTS = ['cs50.net', '*.cs50.net']
455

456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477
############################ OAUTH2 Provider ###################################

# OpenID Connect issuer ID. Normally the URL of the authentication endpoint.

OAUTH_OIDC_ISSUER = 'https:/example.com/oauth2'

# OpenID Connect claim handlers

OAUTH_OIDC_ID_TOKEN_HANDLERS = (
    'oauth2_provider.oidc.handlers.BasicIDTokenHandler',
    'oauth2_provider.oidc.handlers.ProfileHandler',
    'oauth2_provider.oidc.handlers.EmailHandler',
    'oauth2_handler.IDTokenHandler'
)

OAUTH_OIDC_USERINFO_HANDLERS = (
    'oauth2_provider.oidc.handlers.BasicUserInfoHandler',
    'oauth2_provider.oidc.handlers.ProfileHandler',
    'oauth2_provider.oidc.handlers.EmailHandler',
    'oauth2_handler.UserInfoHandler'
)

478
################################## EDX WEB #####################################
479 480
# This is where we stick our compiled template files. Most of the app uses Mako
# templates
481 482
import tempfile
MAKO_MODULE_DIR = os.path.join(tempfile.gettempdir(), 'mako_lms')
Piotr Mitros committed
483
MAKO_TEMPLATES = {}
484
MAKO_TEMPLATES['main'] = [PROJECT_ROOT / 'templates',
485
                          COMMON_ROOT / 'templates',
486
                          COMMON_ROOT / 'lib' / 'capa' / 'capa' / 'templates',
487
                          COMMON_ROOT / 'djangoapps' / 'pipeline_mako' / 'templates']
Piotr Mitros committed
488

489
# This is where Django Template lookup is defined. There are a few of these
490
# still left lying around.
491
TEMPLATE_DIRS = [
492
    PROJECT_ROOT / "templates",
493 494 495
    COMMON_ROOT / 'templates',
    COMMON_ROOT / 'lib' / 'capa' / 'capa' / 'templates',
    COMMON_ROOT / 'djangoapps' / 'pipeline_mako' / 'templates',
496
]
497 498 499

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.core.context_processors.request',
500
    'django.core.context_processors.static',
501
    'django.contrib.messages.context_processors.messages',
502
    'django.core.context_processors.i18n',
503
    'django.contrib.auth.context_processors.auth',  # this is required for admin
504
    'django.core.context_processors.csrf',
505

506 507 508 509 510
    # Added for django-wiki
    'django.core.context_processors.media',
    'django.core.context_processors.tz',
    'django.contrib.messages.context_processors.messages',
    'sekizai.context_processors.sekizai',
511 512

    # Hack to get required link URLs to password reset templates
David Baumgold committed
513
    'edxmako.shortcuts.marketing_link_context_processor',
514

515 516 517
    # Allows the open edX footer to be leveraged in Django Templates.
    'edxmako.shortcuts.open_source_footer_context_processor',

518 519 520 521 522
    # TODO (ECOM-1339): Remove once the V3 version of the footer is enabled permanently
    # This allows us to pass the appropriate feature flag to the main Django template
    # that contains the footer.
    'branding.context_processors.branding_context_processor',

523 524
    # Shoppingcart processor (detects if request.user has a cart)
    'shoppingcart.context_processor.user_has_cart_context_processor',
525 526 527

    # Allows the open edX footer to be leveraged in Django Templates.
    'edxmako.shortcuts.microsite_footer_context_processor',
528 529
)

Diana Huang committed
530 531 532 533
# use the ratelimit backend to prevent brute force attacks
AUTHENTICATION_BACKENDS = (
    'ratelimitbackend.backends.RateLimitModelBackend',
)
534
STUDENT_FILEUPLOAD_MAX_SIZE = 4 * 1000 * 1000  # 4 MB
535
MAX_FILEUPLOADS_PER_INPUT = 20
536

537 538
# FIXME:
# We should have separate S3 staged URLs in case we need to make changes to
539
# these assets and test them.
540
LIB_URL = '/static/js/'
541 542 543

# Dev machines shouldn't need the book
# BOOK_URL = '/static/book/'
544
BOOK_URL = 'https://mitxstatic.s3.amazonaws.com/book_images/'  # For AWS deploys
545
RSS_TIMEOUT = 600
546

547 548 549 550
# Configuration option for when we want to grab server error pages
STATIC_GRAB = False
DEV_CONTENT = True

551
EDX_ROOT_URL = ''
552

553 554
LOGIN_REDIRECT_URL = EDX_ROOT_URL + '/accounts/login'
LOGIN_URL = EDX_ROOT_URL + '/accounts/login'
555

556 557 558 559
COURSE_NAME = "6.002_Spring_2012"
COURSE_NUMBER = "6.002x"
COURSE_TITLE = "Circuits and Electronics"

560
### Dark code. Should be enabled in local settings for devel.
561

562
ENABLE_MULTICOURSE = False  # set to False to disable multicourse display (see lib.util.views.edXhome)
563

564 565
WIKI_ENABLED = False

566 567
###

568
COURSE_DEFAULT = '6.002x_Fall_2012'
Adam Palay committed
569 570 571 572 573 574 575 576
COURSE_SETTINGS = {
    '6.002x_Fall_2012': {
        'number': '6.002x',
        'title': 'Circuits and Electronics',
        'xmlpath': '6002x/',
        'location': 'i4x://edx/6002xs12/course/6.002x_Fall_2012',
    }
}
577

Victor Shnayder committed
578 579 580
# IP addresses that are allowed to reload the course, etc.
# TODO (vshnayder): Will probably need to change as we get real access control in.
LMS_MIGRATION_ALLOWED_IPS = []
581

582 583
# These are standard regexes for pulling out info like course_ids, usage_ids, etc.
# They are used so that URLs with deprecated-format strings still work.
584 585 586 587 588
# Note: these intentionally greedily grab all chars up to the next slash including any pluses
# DHM: I really wanted to ensure the separators were the same (+ or /) but all patts I tried had
# too many inadvertent side effects :-(
COURSE_KEY_PATTERN = r'(?P<course_key_string>[^/+]+(/|\+)[^/+]+(/|\+)[^/]+)'
COURSE_ID_PATTERN = COURSE_KEY_PATTERN.replace('course_key_string', 'course_id')
589
COURSE_KEY_REGEX = COURSE_KEY_PATTERN.replace('P<course_key_string>', ':')
590

591 592 593 594
USAGE_KEY_PATTERN = r'(?P<usage_key_string>(?:i4x://?[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+))'
ASSET_KEY_PATTERN = r'(?P<asset_key_string>(?:/?c4x(:/)?/[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+))'
USAGE_ID_PATTERN = r'(?P<usage_id>(?:i4x://?[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+))'

595 596 597 598

############################## EVENT TRACKING #################################

# FIXME: Should we be doing this truncation?
599
TRACK_MAX_EVENT = 50000
600 601 602 603 604 605 606 607 608 609 610 611

DEBUG_TRACK_LOG = False

TRACKING_BACKENDS = {
    'logger': {
        'ENGINE': 'track.backends.logger.LoggerBackend',
        'OPTIONS': {
            'name': 'tracking'
        }
    }
}

612 613
# We're already logging events, and we don't want to capture user
# names/passwords.  Heartbeat events are likely not interesting.
614
TRACKING_IGNORE_URL_PATTERNS = [r'^/event', r'^/login', r'^/heartbeat', r'^/segmentio/event', r'^/performance']
615 616 617

EVENT_TRACKING_ENABLED = True
EVENT_TRACKING_BACKENDS = {
618 619
    'tracking_logs': {
        'ENGINE': 'eventtracking.backends.routing.RoutingBackend',
620
        'OPTIONS': {
621 622 623 624 625 626 627 628 629 630 631 632 633
            'backends': {
                'logger': {
                    'ENGINE': 'eventtracking.backends.logger.LoggerBackend',
                    'OPTIONS': {
                        'name': 'tracking',
                        'max_event_size': TRACK_MAX_EVENT,
                    }
                }
            },
            'processors': [
                {'ENGINE': 'track.shim.LegacyFieldMappingProcessor'},
                {'ENGINE': 'track.shim.VideoEventProcessor'}
            ]
634
        }
635
    },
636 637 638 639 640 641 642 643 644 645 646 647
    'segmentio': {
        'ENGINE': 'eventtracking.backends.routing.RoutingBackend',
        'OPTIONS': {
            'backends': {
                'segment': {'ENGINE': 'eventtracking.backends.segment.SegmentBackend'}
            },
            'processors': [
                {
                    'ENGINE': 'eventtracking.processors.whitelist.NameWhitelistProcessor',
                    'OPTIONS': {
                        'whitelist': []
                    }
648 649 650
                },
                {
                    'ENGINE': 'track.shim.GoogleAnalyticsProcessor'
651 652 653
                }
            ]
        }
654
    }
655 656
}
EVENT_TRACKING_PROCESSORS = []
657

658
# Backwards compatibility with ENABLE_SQL_TRACKING_LOGS feature flag.
659
# In the future, adding the backend to TRACKING_BACKENDS should be enough.
660
if FEATURES.get('ENABLE_SQL_TRACKING_LOGS'):
661 662 663 664 665
    TRACKING_BACKENDS.update({
        'sql': {
            'ENGINE': 'track.backends.django.DjangoBackend'
        }
    })
666 667 668 669 670
    EVENT_TRACKING_BACKENDS.update({
        'sql': {
            'ENGINE': 'track.backends.django.DjangoBackend'
        }
    })
671

672
TRACKING_SEGMENTIO_WEBHOOK_SECRET = None
673
TRACKING_SEGMENTIO_ALLOWED_TYPES = ['track']
674
TRACKING_SEGMENTIO_DISALLOWED_SUBSTRING_NAMES = ['.bi.']
675 676 677 678
TRACKING_SEGMENTIO_SOURCE_MAP = {
    'analytics-android': 'mobile',
    'analytics-ios': 'mobile',
}
679

680
######################## GOOGLE ANALYTICS ###########################
681
GOOGLE_ANALYTICS_ACCOUNT = None
682 683
GOOGLE_ANALYTICS_LINKEDIN = 'GOOGLE_ANALYTICS_LINKEDIN_DUMMY'

684 685 686
######################## OPTIMIZELY ###########################
OPTIMIZELY_PROJECT_ID = None

687 688 689
######################## subdomain specific settings ###########################
COURSE_LISTINGS = {}
SUBDOMAIN_BRANDING = {}
690
VIRTUAL_UNIVERSITIES = []
691

Calen Pennington committed
692 693
############# XBlock Configuration ##########

694 695 696 697 698
# Import after sys.path fixup
from xmodule.modulestore.inheritance import InheritanceMixin
from xmodule.modulestore import prefer_xmodules
from xmodule.x_module import XModuleMixin

699
# These are the Mixins that should be added to every XBlock.
Calen Pennington committed
700 701
# This should be moved into an XBlock Runtime/Application object
# once the responsibility of XBlock creation is moved out of modulestore - cpennington
702
XBLOCK_MIXINS = (LmsBlockMixin, InheritanceMixin, XModuleMixin)
Calen Pennington committed
703

704 705
# Allow any XBlock in the LMS
XBLOCK_SELECT_FUNCTION = prefer_xmodules
706

707 708
############# ModuleStore Configuration ##########

Nimisha Asthagiri committed
709
MODULESTORE_BRANCH = 'published-only'
710 711 712 713 714
CONTENTSTORE = None
DOC_STORE_CONFIG = {
    'host': 'localhost',
    'db': 'xmodule',
    'collection': 'modulestore',
715 716 717
    # If 'asset_collection' defined, it'll be used
    # as the collection name for asset metadata.
    # Otherwise, a default collection name will be used.
718 719 720 721 722 723 724 725
}
MODULESTORE = {
    'default': {
        'ENGINE': 'xmodule.modulestore.mixed.MixedModuleStore',
        'OPTIONS': {
            'mappings': {},
            'stores': [
                {
cahrens committed
726 727
                    'NAME': 'split',
                    'ENGINE': 'xmodule.modulestore.split_mongo.split_draft.DraftVersioningModuleStore',
728 729 730 731 732 733 734 735
                    'DOC_STORE_CONFIG': DOC_STORE_CONFIG,
                    'OPTIONS': {
                        'default_class': 'xmodule.hidden_module.HiddenDescriptor',
                        'fs_root': DATA_DIR,
                        'render_template': 'edxmako.shortcuts.render_to_string',
                    }
                },
                {
cahrens committed
736 737 738
                    'NAME': 'draft',
                    'ENGINE': 'xmodule.modulestore.mongo.DraftMongoModuleStore',
                    'DOC_STORE_CONFIG': DOC_STORE_CONFIG,
739 740
                    'OPTIONS': {
                        'default_class': 'xmodule.hidden_module.HiddenDescriptor',
cahrens committed
741 742
                        'fs_root': DATA_DIR,
                        'render_template': 'edxmako.shortcuts.render_to_string',
743 744
                    }
                },
745
                {
cahrens committed
746 747
                    'NAME': 'xml',
                    'ENGINE': 'xmodule.modulestore.xml.XMLModuleStore',
748
                    'OPTIONS': {
cahrens committed
749
                        'data_dir': DATA_DIR,
750 751
                        'default_class': 'xmodule.hidden_module.HiddenDescriptor',
                    }
cahrens committed
752
                }
753 754 755 756 757
            ]
        }
    }
}

758 759 760 761 762 763 764
#################### Python sandbox ############################################

CODE_JAIL = {
    # Path to a sandboxed Python executable.  None means don't bother.
    'python_bin': None,
    # User to run as in the sandbox.
    'user': 'sandbox',
765 766 767 768 769 770

    # Configurable limits.
    'limits': {
        # How many CPU seconds can jailed code use?
        'CPU': 1,
    },
771 772
}

773 774 775 776 777 778 779 780 781
# Some courses are allowed to run unsafe code. This is a list of regexes, one
# of them must match the course id for that course to run unsafe code.
#
# For example:
#
#   COURSES_WITH_UNSAFE_CODE = [
#       r"Harvard/XY123.1/.*"
#   ]
COURSES_WITH_UNSAFE_CODE = []
782

783 784 785 786
############################### DJANGO BUILT-INS ###############################
# Change DEBUG/TEMPLATE_DEBUG in your environment settings files, not here
DEBUG = False
TEMPLATE_DEBUG = False
787
USE_TZ = True
788
SESSION_COOKIE_SECURE = False
789

790 791 792
# CMS base
CMS_BASE = 'localhost:8001'

793 794
# Site info
SITE_ID = 1
795
SITE_NAME = "example.com"
796
HTTPS = 'on'
797
ROOT_URLCONF = 'lms.urls'
798
# NOTE: Please set ALLOWED_HOSTS to some sane value, as we do not allow the default '*'
799

800
# Platform Email
801
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
802 803 804 805 806 807
DEFAULT_FROM_EMAIL = 'registration@example.com'
DEFAULT_FEEDBACK_EMAIL = 'feedback@example.com'
SERVER_EMAIL = 'devops@example.com'
TECH_SUPPORT_EMAIL = 'technical@example.com'
CONTACT_EMAIL = 'info@example.com'
BUGS_EMAIL = 'bugs@example.com'
808 809
UNIVERSITY_EMAIL = 'university@example.com'
PRESS_EMAIL = 'press@example.com'
810
FINANCE_EMAIL = ''
811
ADMINS = ()
812 813
MANAGERS = ADMINS

814 815 816
EDX_PLATFORM_REVISION = os.environ.get('EDX_PLATFORM_REVISION')

if not EDX_PLATFORM_REVISION:
817 818 819 820 821 822
    try:
        # Get git revision of the current file
        EDX_PLATFORM_REVISION = dealer.git.Backend(path=REPO_ROOT).revision
    except TypeError:
        # Not a git repository
        EDX_PLATFORM_REVISION = 'unknown'
823

824
# Static content
825
STATIC_URL = '/static/'
826
STATIC_ROOT = ENV_ROOT / "staticfiles"
827

828
STATICFILES_DIRS = [
829
    COMMON_ROOT / "static",
830
    PROJECT_ROOT / "static",
831
]
832

833 834
FAVICON_PATH = 'images/favicon.ico'

835 836 837 838
# User-uploaded content
MEDIA_ROOT = '/edx/var/edxapp/media/'
MEDIA_URL = '/media/'

839
# Locale/Internationalization
840 841
TIME_ZONE = 'America/New_York'  # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
LANGUAGE_CODE = 'en'  # http://www.i18nguy.com/unicode/language-identifiers.html
842
# these languages display right to left
843
LANGUAGES_BIDI = ("he", "ar", "fa", "ur", "fa-ir", "rtl")
844

845
# Sourced from http://www.localeplanet.com/icu/ and wikipedia
846
LANGUAGES = (
847
    ('en', u'English'),
848
    ('rtl', u'Right-to-Left Test Language'),
849
    ('eo', u'Dummy Language (Esperanto)'),  # Dummy languaged used for testing
850
    ('fake2', u'Fake translations'),        # Another dummy language for testing (not pushed to prod)
851

Sarina Canelake committed
852
    ('am', u'አማርኛ'),  # Amharic
853
    ('ar', u'العربية'),  # Arabic
854 855 856
    ('az', u'azərbaycanca'),  # Azerbaijani
    ('bg-bg', u'български (България)'),  # Bulgarian (Bulgaria)
    ('bn-bd', u'বাংলা (বাংলাদেশ)'),  # Bengali (Bangladesh)
Sarina Canelake committed
857
    ('bn-in', u'বাংলা (ভারত)'),  # Bengali (India)
858
    ('bs', u'bosanski'),  # Bosnian
859
    ('ca', u'Català'),  # Catalan
860
    ('ca@valencia', u'Català (València)'),  # Catalan (Valencia)
861
    ('cs', u'Čeština'),  # Czech
862
    ('cy', u'Cymraeg'),  # Welsh
Sarina Canelake committed
863
    ('da', u'dansk'),  # Danish
864
    ('de-de', u'Deutsch (Deutschland)'),  # German (Germany)
865
    ('el', u'Ελληνικά'),  # Greek
866
    ('en-uk', u'English (United Kingdom)'),  # English (United Kingdom)
867 868 869
    ('en@lolcat', u'LOLCAT English'),  # LOLCAT English
    ('en@pirate', u'Pirate English'),  # Pirate English
    ('es-419', u'Español (Latinoamérica)'),  # Spanish (Latin America)
870 871
    ('es-ar', u'Español (Argentina)'),  # Spanish (Argentina)
    ('es-ec', u'Español (Ecuador)'),  # Spanish (Ecuador)
872
    ('es-es', u'Español (España)'),  # Spanish (Spain)
873 874 875 876 877 878 879
    ('es-mx', u'Español (México)'),  # Spanish (Mexico)
    ('es-pe', u'Español (Perú)'),  # Spanish (Peru)
    ('et-ee', u'Eesti (Eesti)'),  # Estonian (Estonia)
    ('eu-es', u'euskara (Espainia)'),  # Basque (Spain)
    ('fa', u'فارسی'),  # Persian
    ('fa-ir', u'فارسی (ایران)'),  # Persian (Iran)
    ('fi-fi', u'Suomi (Suomi)'),  # Finnish (Finland)
880
    ('fil', u'Filipino'),  # Filipino
881
    ('fr', u'Français'),  # French
882
    ('gl', u'Galego'),  # Galician
Sarina Canelake committed
883
    ('gu', u'ગુજરાતી'),  # Gujarati
884
    ('he', u'עברית'),  # Hebrew
885
    ('hi', u'हिन्दी'),  # Hindi
Sarina Canelake committed
886
    ('hr', u'hrvatski'),  # Croatian
887
    ('hu', u'magyar'),  # Hungarian
888
    ('hy-am', u'Հայերեն (Հայաստան)'),  # Armenian (Armenia)
889 890
    ('id', u'Bahasa Indonesia'),  # Indonesian
    ('it-it', u'Italiano (Italia)'),  # Italian (Italy)
Sarina Canelake committed
891
    ('ja-jp', u'日本語 (日本)'),  # Japanese (Japan)
892 893
    ('kk-kz', u'қазақ тілі (Қазақстан)'),  # Kazakh (Kazakhstan)
    ('km-kh', u'ភាសាខ្មែរ (កម្ពុជា)'),  # Khmer (Cambodia)
Sarina Canelake committed
894
    ('kn', u'ಕನ್ನಡ'),  # Kannada
Sarina Canelake committed
895
    ('ko-kr', u'한국어 (대한민국)'),  # Korean (Korea)
896
    ('lt-lt', u'Lietuvių (Lietuva)'),  # Lithuanian (Lithuania)
897 898
    ('ml', u'മലയാളം'),  # Malayalam
    ('mn', u'Монгол хэл'),  # Mongolian
899
    ('mr', u'मराठी'),  # Marathi
900
    ('ms', u'Bahasa Melayu'),  # Malay
901
    ('nb', u'Norsk bokmål'),  # Norwegian Bokmål
902
    ('ne', u'नेपाली'),  # Nepali
903
    ('nl-nl', u'Nederlands (Nederland)'),  # Dutch (Netherlands)
Sarina Canelake committed
904
    ('or', u'ଓଡ଼ିଆ'),  # Oriya
905 906
    ('pl', u'Polski'),  # Polish
    ('pt-br', u'Português (Brasil)'),  # Portuguese (Brazil)
907
    ('pt-pt', u'Português (Portugal)'),  # Portuguese (Portugal)
Sarina Canelake committed
908
    ('ro', u'română'),  # Romanian
909 910 911
    ('ru', u'Русский'),  # Russian
    ('si', u'සිංහල'),  # Sinhala
    ('sk', u'Slovenčina'),  # Slovak
912
    ('sl', u'Slovenščina'),  # Slovenian
913
    ('sq', u'shqip'),  # Albanian
914
    ('sr', u'Српски'),  # Serbian
915 916
    ('sv', u'svenska'),  # Swedish
    ('sw', u'Kiswahili'),  # Swahili
Sarina Canelake committed
917
    ('ta', u'தமிழ்'),  # Tamil
918
    ('te', u'తెలుగు'),  # Telugu
919
    ('th', u'ไทย'),  # Thai
920
    ('tr-tr', u'Türkçe (Türkiye)'),  # Turkish (Turkey)
921
    ('uk', u'Українська'),  # Ukranian
922
    ('ur', u'اردو'),  # Urdu
923
    ('vi', u'Tiếng Việt'),  # Vietnamese
924
    ('uz', u'Ўзбек'),  # Uzbek
Sarina Canelake committed
925
    ('zh-cn', u'中文 (简体)'),  # Chinese (China)
926
    ('zh-hk', u'中文 (香港)'),  # Chinese (Hong Kong)
Sarina Canelake committed
927
    ('zh-tw', u'中文 (台灣)'),  # Chinese (Taiwan)
928 929
)

930 931
LANGUAGE_DICT = dict(LANGUAGES)

932
USE_I18N = True
933
USE_L10N = True
934

935 936
# Localization strings (e.g. django.po) are under this directory
LOCALE_PATHS = (REPO_ROOT + '/conf/locale',)  # edx-platform/conf/locale/
937 938 939
# Messages
MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'

940
# Guidelines for translators
941
TRANSLATORS_GUIDE = 'http://edx.readthedocs.org/projects/edx-developer-guide/en/latest/internationalization/i18n_translators_guide.html'  # pylint: disable=line-too-long
942

943 944 945 946
#################################### GITHUB #######################################
# gitreload is used in LMS-workflow to pull content from github
# gitreload requests are only allowed from these IP addresses, which are
# the advertised public IPs of the github WebHook servers.
947
# These are listed, eg at https://github.com/edx/edx-platform/admin/hooks
948

949
ALLOWED_GITRELOAD_IPS = ['207.97.227.253', '50.57.128.197', '108.171.174.178']
950

951
#################################### AWS #######################################
952
# S3BotoStorage insists on a timeout for uploaded assets. We should make it
953
# permanent instead, but rather than trying to figure out exactly where that
954
# setting is, I'm just bumping the expiration time to something absurd (100
955 956
# years). This is only used if DEFAULT_FILE_STORAGE is overriden to use S3
# in the global settings.py
957
AWS_QUERYSTRING_EXPIRE = 10 * 365 * 24 * 60 * 60  # 10 years
958

959
################################# SIMPLEWIKI ###################################
960 961
SIMPLE_WIKI_REQUIRE_LOGIN_EDIT = True
SIMPLE_WIKI_REQUIRE_LOGIN_VIEW = False
962

963
################################# WIKI ###################################
964 965
from course_wiki import settings as course_wiki_settings

966
WIKI_ACCOUNT_HANDLING = False
967
WIKI_EDITOR = 'course_wiki.editors.CodeMirror'
968 969
WIKI_SHOW_MAX_CHILDREN = 0  # We don't use the little menu that shows children of an article in the breadcrumb
WIKI_ANONYMOUS = False  # Don't allow anonymous access until the styling is figured out
970 971 972 973 974

WIKI_CAN_DELETE = course_wiki_settings.CAN_DELETE
WIKI_CAN_MODERATE = course_wiki_settings.CAN_MODERATE
WIKI_CAN_CHANGE_PERMISSIONS = course_wiki_settings.CAN_CHANGE_PERMISSIONS
WIKI_CAN_ASSIGN = course_wiki_settings.CAN_ASSIGN
975 976

WIKI_USE_BOOTSTRAP_SELECT_WIDGET = False
977
WIKI_LINK_LIVE_LOOKUPS = False
978
WIKI_LINK_DEFAULT_LEVEL = 2
979

980 981 982 983 984 985 986 987
##### Feedback submission mechanism #####
FEEDBACK_SUBMISSION_EMAIL = None

##### Zendesk #####
ZENDESK_URL = None
ZENDESK_USER = None
ZENDESK_API_KEY = None

988 989 990
##### EMBARGO #####
EMBARGO_SITE_REDIRECT_URL = None

991
##### shoppingcart Payment #####
992
PAYMENT_SUPPORT_EMAIL = 'payment@example.com'
993

994
##### Using cybersource by default #####
995 996

CC_PROCESSOR_NAME = 'CyberSource'
997
CC_PROCESSOR = {
998
    'CyberSource': {
999
        'SHARED_SECRET': '',
1000 1001
        'MERCHANT_ID': '',
        'SERIAL_NUMBER': '',
1002 1003
        'ORDERPAGE_VERSION': '7',
        'PURCHASE_ENDPOINT': '',
1004 1005 1006 1007 1008 1009
    },
    'CyberSource2': {
        "PURCHASE_ENDPOINT": '',
        "SECRET_KEY": '',
        "ACCESS_KEY": '',
        "PROFILE_ID": '',
1010
    }
1011
}
1012

1013 1014
# Setting for PAID_COURSE_REGISTRATION, DOES NOT AFFECT VERIFIED STUDENTS
PAID_COURSE_REGISTRATION_CURRENCY = ['usd', '$']
1015 1016 1017 1018

# Members of this group are allowed to generate payment reports
PAYMENT_REPORT_GENERATOR_GROUP = 'shoppingcart_report_access'

1019
################################# open ended grading config  #####################
1020 1021 1022

#By setting up the default settings with an incorrect user name and password,
# will get an error when attempting to connect
1023
OPEN_ENDED_GRADING_INTERFACE = {
1024
    'url': 'http://example.com/peer_grading',
1025 1026
    'username': 'incorrect_user',
    'password': 'incorrect_pass',
Diana Huang committed
1027 1028 1029 1030
    'staff_grading': 'staff_grading',
    'peer_grading': 'peer_grading',
    'grading_controller': 'grading_controller'
}
1031

1032
# Used for testing, debugging peer grading
1033
MOCK_PEER_GRADING = False
1034

1035 1036 1037
# Used for testing, debugging staff grading
MOCK_STAFF_GRADING = False

1038 1039 1040 1041

################################# EdxNotes config  #########################

# Configure the LMS to use our stub EdxNotes implementation
1042 1043
EDXNOTES_PUBLIC_API = 'http://localhost:8120/api/v1'
EDXNOTES_INTERNAL_API = 'http://localhost:8120/api/v1'
1044

1045 1046 1047 1048 1049 1050
########################## Parental controls config  #######################

# The age at which a learner no longer requires parental consent, or None
# if parental consent is never required.
PARENTAL_CONSENT_AGE_LIMIT = 13

1051
################################# Jasmine ##################################
1052
JASMINE_TEST_DIRECTORY = PROJECT_ROOT + '/static/coffee'
1053

1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095

######################### Branded Footer ###################################
# Constants for the footer used on the site and shared with other sites
# (such as marketing and the blog) via the branding API.

# URL for OpenEdX displayed in the footer
FOOTER_OPENEDX_URL = "http://open.edx.org"

# URL for the OpenEdX logo image
# We use logo images served from files.edx.org so we can (roughly) track
# how many OpenEdX installations are running.
# Site operators can choose from these logo options:
# * https://files.edx.org/openedx-logos/edx-openedx-logo-tag.png
# * https://files.edx.org/openedx-logos/edx-openedx-logo-tag-light.png"
# * https://files.edx.org/openedx-logos/edx-openedx-logo-tag-dark.png
FOOTER_OPENEDX_LOGO_IMAGE = "https://files.edx.org/openedx-logos/edx-openedx-logo-tag.png"

# This is just a placeholder image.
# Site operators can customize this with their organization's image.
FOOTER_ORGANIZATION_IMAGE = "images/default-theme/logo.png"

# These are referred to both by the Django asset pipeline
# AND by the branding footer API, which needs to decide which
# version of the CSS to serve.
FOOTER_CSS = {
    "openedx": {
        "ltr": "style-lms-footer",
        "rtl": "style-lms-footer-rtl",
    },
    "edx": {
        "ltr": "style-lms-footer-edx",
        "rtl": "style-lms-footer-edx-rtl",
    },
}

# Cache expiration for the version of the footer served
# by the branding API.
FOOTER_CACHE_TIMEOUT = 30 * 60

# Max age cache control header for the footer (controls browser caching).
FOOTER_BROWSER_CACHE_MAX_AGE = 5 * 60

1096 1097 1098 1099 1100
################################# Deprecation warnings #####################

# Ignore deprecation warnings (so we don't clutter Jenkins builds/production)
simplefilter('ignore')

1101 1102 1103 1104
################################# Middleware ###################################
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
1105 1106
    'staticfiles.finders.FileSystemFinder',
    'staticfiles.finders.AppDirectoriesFinder',
Will Daly committed
1107
    'pipeline.finders.PipelineFinder',
1108 1109 1110 1111
)

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
David Baumgold committed
1112 1113
    'edxmako.makoloader.MakoFilesystemLoader',
    'edxmako.makoloader.MakoAppDirectoriesLoader',
1114

1115 1116
    # 'django.template.loaders.filesystem.Loader',
    # 'django.template.loaders.app_directories.Loader',
1117

1118 1119 1120
)

MIDDLEWARE_CLASSES = (
1121
    'request_cache.middleware.RequestCache',
1122
    'microsite_configuration.middleware.MicrositeMiddleware',
Rocky Duan committed
1123
    'django_comment_client.middleware.AjaxExceptionMiddleware',
1124 1125
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
1126 1127

    # Instead of AuthenticationMiddleware, we use a cached backed version
1128 1129
    #'django.contrib.auth.middleware.AuthenticationMiddleware',
    'cache_toolbox.middleware.CacheBackedAuthenticationMiddleware',
1130
    'student.middleware.UserStandingMiddleware',
1131
    'contentserver.middleware.StaticContentServer',
1132
    'crum.CurrentRequestUserMiddleware',
1133

1134 1135
    # Adds user tags to tracking events
    # Must go before TrackMiddleware, to get the context set up
1136
    'openedx.core.djangoapps.user_api.middleware.UserTagsEventContextMiddleware',
1137

1138 1139
    'django.contrib.messages.middleware.MessageMiddleware',
    'track.middleware.TrackMiddleware',
Will Daly committed
1140 1141 1142 1143 1144

    # CORS and CSRF
    'corsheaders.middleware.CorsMiddleware',
    'cors_csrf.middleware.CorsCSRFMiddleware',
    'cors_csrf.middleware.CsrfCrossDomainCookieMiddleware',
1145
    'django.middleware.csrf.CsrfViewMiddleware',
Will Daly committed
1146

1147
    'splash.middleware.SplashMiddleware',
1148

1149 1150
    # Allows us to dark-launch particular languages
    'dark_lang.middleware.DarkLangMiddleware',
1151
    'geoinfo.middleware.CountryMiddleware',
1152
    'embargo.middleware.EmbargoMiddleware',
1153

1154 1155
    # Allows us to set user preferences
    # should be after DarkLangMiddleware
1156
    'lang_pref.middleware.LanguagePreferenceMiddleware',
1157

1158 1159 1160
    # Detects user-requested locale from 'accept-language' header in http request
    'django.middleware.locale.LocaleMiddleware',

1161
    'django.middleware.transaction.TransactionMiddleware',
1162
    # 'debug_toolbar.middleware.DebugToolbarMiddleware',
1163 1164

    'django_comment_client.utils.ViewNameMiddleware',
1165
    'codejail.django_integration.ConfigureCodeJailMiddleware',
Diana Huang committed
1166 1167 1168

    # catches any uncaught RateLimitExceptions and returns a 403 instead of a 500
    'ratelimitbackend.middleware.RateLimitMiddleware',
1169 1170
    # needs to run after locale middleware (or anything that modifies the request context)
    'edxmako.middleware.MakoMiddleware',
1171

1172 1173
    # for expiring inactive sessions
    'session_inactivity_timeout.middleware.SessionInactivityTimeout',
1174

1175 1176
    # use Django built in clickjacking protection
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
1177

1178 1179 1180
    # to redirected unenrolled students to the course info page
    'courseware.middleware.RedirectUnenrolledMiddleware',

1181
    'course_wiki.middleware.WikiAccessMiddleware',
1182 1183 1184

    # This must be last
    'microsite_configuration.middleware.MicrositeSessionCookieDomainMiddleware',
1185 1186
)

1187 1188 1189
# Clickjacking protection can be enabled by setting this to 'DENY'
X_FRAME_OPTIONS = 'ALLOW'

1190 1191
############################### Pipeline #######################################

1192
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
1193

1194
from openedx.core.lib.rooted_paths import rooted_glob
1195

1196 1197
courseware_js = (
    [
1198
        'coffee/src/' + pth + '.js'
1199 1200
        for pth in ['courseware', 'histogram', 'navigation', 'time']
    ] +
1201
    ['js/' + pth + '.js' for pth in ['ajax-error']] +
1202
    ['js/search/course/main.js'] +
1203
    sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/modules/**/*.js'))
1204
)
1205

1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218

# Before a student accesses courseware, we do not
# need many of the JS dependencies.  This includes
# only the dependencies used everywhere in the LMS
# (including the dashboard/account/profile pages)
# Currently, this partially duplicates the "main vendor"
# JavaScript file, so only one of the two should be included
# on a page at any time.
# In the future, we will likely refactor this to use
# RequireJS and an optimizer.
base_vendor_js = [
    'js/vendor/jquery.min.js',
    'js/vendor/jquery.cookie.js',
1219
    'js/vendor/url.min.js',
1220 1221 1222
    'js/vendor/underscore-min.js',
    'js/vendor/require.js',
    'js/RequireJS-namespace-undefine.js',
1223 1224 1225
]

main_vendor_js = base_vendor_js + [
1226 1227 1228 1229 1230
    'js/vendor/json2.js',
    'js/vendor/jquery-ui.min.js',
    'js/vendor/jquery.qtip.min.js',
    'js/vendor/swfobject/swfobject.js',
    'js/vendor/jquery.ba-bbq.min.js',
1231
    'js/vendor/URI.min.js',
1232
]
1233

1234 1235 1236 1237
dashboard_js = (
    sorted(rooted_glob(PROJECT_ROOT / 'static', 'js/dashboard/**/*.js')) +
    ['js/search/dashboard/main.js']
)
1238
discussion_js = sorted(rooted_glob(COMMON_ROOT / 'static', 'coffee/src/discussion/**/*.js'))
1239
rwd_header_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'js/utils/rwd_header.js'))
1240 1241
staff_grading_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/staff_grading/**/*.js'))
open_ended_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/open_ended/**/*.js'))
daniel cebrian committed
1242
notes_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/notes/**/*.js'))
1243 1244 1245 1246
instructor_dash_js = (
    sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/instructor_dashboard/**/*.js')) +
    sorted(rooted_glob(PROJECT_ROOT / 'static', 'js/instructor_dashboard/**/*.js'))
)
1247

1248 1249 1250
# JavaScript used by the student account and profile pages
# These are not courseware, so they do not need many of the courseware-specific
# JavaScript modules.
1251
student_account_js = [
1252
    'js/utils/rwd_header.js',
1253
    'js/utils/edx.utils.validate.js',
1254 1255 1256 1257 1258
    'js/form.ext.js',
    'js/my_courses_dropdown.js',
    'js/toggle_login_modal.js',
    'js/sticky_filter.js',
    'js/query-params.js',
1259
    'js/src/utility.js',
1260 1261 1262
    'js/src/accessibility_tools.js',
    'js/src/ie_shim.js',
    'js/src/string_utils.js',
1263
    'js/student_account/enrollment.js',
1264
    'js/student_account/emailoptin.js',
1265
    'js/student_account/shoppingcart.js',
1266
    'js/student_account/models/LoginModel.js',
1267
    'js/student_account/models/RegisterModel.js',
1268
    'js/student_account/models/PasswordResetModel.js',
1269
    'js/student_account/views/FormView.js',
1270
    'js/student_account/views/LoginView.js',
1271
    'js/student_account/views/RegisterView.js',
1272
    'js/student_account/views/PasswordResetView.js',
1273 1274 1275
    'js/student_account/views/AccessView.js',
    'js/student_account/accessApp.js',
]
1276

1277 1278
student_profile_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'js/student_profile/**/*.js'))

1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290
verify_student_js = [
    'js/form.ext.js',
    'js/my_courses_dropdown.js',
    'js/toggle_login_modal.js',
    'js/sticky_filter.js',
    'js/query-params.js',
    'js/src/utility.js',
    'js/src/accessibility_tools.js',
    'js/src/ie_shim.js',
    'js/src/string_utils.js',
    'js/verify_student/models/verification_model.js',
    'js/verify_student/views/error_view.js',
1291
    'js/verify_student/views/image_input_view.js',
1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304
    'js/verify_student/views/webcam_photo_view.js',
    'js/verify_student/views/step_view.js',
    'js/verify_student/views/intro_step_view.js',
    'js/verify_student/views/make_payment_step_view.js',
    'js/verify_student/views/payment_confirmation_step_view.js',
    'js/verify_student/views/face_photo_step_view.js',
    'js/verify_student/views/id_photo_step_view.js',
    'js/verify_student/views/review_photos_step_view.js',
    'js/verify_student/views/enrollment_confirmation_step_view.js',
    'js/verify_student/views/pay_and_verify_view.js',
    'js/verify_student/pay_and_verify.js',
]

1305 1306 1307 1308 1309 1310 1311 1312 1313
reverify_js = [
    'js/verify_student/views/error_view.js',
    'js/verify_student/views/image_input_view.js',
    'js/verify_student/views/webcam_photo_view.js',
    'js/verify_student/models/reverification_model.js',
    'js/verify_student/views/incourse_reverify_view.js',
    'js/verify_student/incourse_reverify.js',
]

cewing committed
1314 1315
ccx_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'js/ccx/**/*.js'))

1316 1317
discovery_js = ['js/discovery/main.js']

1318

1319
PIPELINE_CSS = {
1320 1321 1322 1323
    'style-vendor': {
        'source_filenames': [
            'css/vendor/font-awesome.css',
            'css/vendor/jquery.qtip.min.css',
1324 1325
            'css/vendor/responsive-carousel/responsive-carousel.css',
            'css/vendor/responsive-carousel/responsive-carousel.slide.css',
1326 1327
        ],
        'output_filename': 'css/lms-style-vendor.css',
1328
    },
1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340
    'style-vendor-tinymce-content': {
        'source_filenames': [
            'js/vendor/tinymce/js/tinymce/skins/studio-tmce4/content.min.css'
        ],
        'output_filename': 'css/lms-style-vendor-tinymce-content.css',
    },
    'style-vendor-tinymce-skin': {
        'source_filenames': [
            'js/vendor/tinymce/js/tinymce/skins/studio-tmce4/skin.min.css'
        ],
        'output_filename': 'css/lms-style-vendor-tinymce-skin.css',
    },
1341
    'style-main': {
1342
        'source_filenames': [
1343
            'sass/lms-main.css',
1344
            'css/edx-cc.css',
1345
        ],
1346
        'output_filename': 'css/lms-main.css',
1347
    },
1348
    'style-main-rtl': {
1349
        'source_filenames': [
1350
            'sass/lms-main-rtl.css',
1351
            'css/edx-cc.css',
1352
        ],
1353
        'output_filename': 'css/lms-main-rtl.css',
1354
    },
1355
    'style-course-vendor': {
1356 1357 1358 1359
        'source_filenames': [
            'js/vendor/CodeMirror/codemirror.css',
            'css/vendor/jquery.treeview.css',
            'css/vendor/ui-lightness/jquery-ui-1.8.22.custom.css',
1360 1361 1362 1363 1364
        ],
        'output_filename': 'css/lms-style-course-vendor.css',
    },
    'style-course': {
        'source_filenames': [
1365
            'sass/lms-course.css',
1366
            'xmodule/modules.css',
1367
        ],
1368
        'output_filename': 'css/lms-course.css',
1369
    },
1370 1371
    'style-course-rtl': {
        'source_filenames': [
1372
            'sass/lms-course-rtl.css',
1373 1374
            'xmodule/modules.css',
        ],
1375 1376 1377 1378 1379 1380 1381
        'output_filename': 'css/lms-course-rtl.css',
    },
    'style-student-notes': {
        'source_filenames': [
            'css/vendor/edxnotes/annotator.min.css',
        ],
        'output_filename': 'css/lms-style-student-notes.css',
1382
    },
1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399
    'style-xmodule-annotations': {
        'source_filenames': [
            'css/vendor/ova/annotator.css',
            'css/vendor/ova/edx-annotator.css',
            'css/vendor/ova/video-js.min.css',
            'css/vendor/ova/rangeslider.css',
            'css/vendor/ova/share-annotator.css',
            'css/vendor/ova/richText-annotator.css',
            'css/vendor/ova/tags-annotator.css',
            'css/vendor/ova/flagging-annotator.css',
            'css/vendor/ova/diacritic-annotator.css',
            'css/vendor/ova/grouping-annotator.css',
            'css/vendor/ova/ova.css',
            'js/vendor/ova/catch/css/main.css'
        ],
        'output_filename': 'css/lms-style-xmodule-annotations.css',
    },
1400
    FOOTER_CSS['openedx']['ltr']: {
1401
        'source_filenames': [
1402
            'sass/lms-footer.css',
1403
        ],
1404
        'output_filename': 'css/lms-footer.css',
1405
    },
1406
    FOOTER_CSS['openedx']['rtl']: {
1407
        'source_filenames': [
1408
            'sass/lms-footer-rtl.css',
1409
        ],
1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422
        'output_filename': 'css/lms-footer-rtl.css'
    },
    FOOTER_CSS['edx']['ltr']: {
        'source_filenames': [
            'sass/lms-footer-edx.css',
        ],
        'output_filename': 'css/lms-footer-edx.css'
    },
    FOOTER_CSS['edx']['rtl']: {
        'source_filenames': [
            'sass/lms-footer-edx-rtl.css',
        ],
        'output_filename': 'css/lms-footer-edx-rtl.css'
1423
    },
1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437
    'style-certificates': {
        'source_filenames': [
            'certificates/sass/main-ltr.css',
            'css/vendor/font-awesome.css',
        ],
        'output_filename': 'css/certificates-style.css'
    },
    'style-certificates-rtl': {
        'source_filenames': [
            'certificates/sass/main-rtl.css',
            'css/vendor/font-awesome.css',
        ],
        'output_filename': 'css/certificates-style-rtl.css'
    },
1438
}
1439

1440

1441 1442
common_js = set(rooted_glob(COMMON_ROOT / 'static', 'coffee/src/**/*.js')) - set(courseware_js + discussion_js + staff_grading_js + open_ended_js + notes_js + instructor_dash_js)    # pylint: disable=line-too-long
project_js = set(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/**/*.js')) - set(courseware_js + discussion_js + staff_grading_js + open_ended_js + notes_js + instructor_dash_js)  # pylint: disable=line-too-long
1443 1444


1445 1446
PIPELINE_JS = {
    'application': {
1447

1448
        # Application will contain all paths not in courseware_only_js
1449
        'source_filenames': ['js/xblock/core.js'] + sorted(common_js) + sorted(project_js) + [
1450 1451 1452 1453
            'js/form.ext.js',
            'js/my_courses_dropdown.js',
            'js/toggle_login_modal.js',
            'js/sticky_filter.js',
1454
            'js/query-params.js',
1455
            'js/src/utility.js',
1456
            'js/src/accessibility_tools.js',
1457
            'js/src/ie_shim.js',
1458
            'js/src/string_utils.js',
1459
            'js/src/logger.js',
1460
        ],
1461
        'output_filename': 'js/lms-application.js',
1462
    },
1463
    'courseware': {
1464
        'source_filenames': courseware_js,
1465
        'output_filename': 'js/lms-courseware.js',
1466 1467 1468 1469
    },
    'base_vendor': {
        'source_filenames': base_vendor_js,
        'output_filename': 'js/lms-base-vendor.js',
1470
    },
1471 1472
    'main_vendor': {
        'source_filenames': main_vendor_js,
1473
        'output_filename': 'js/lms-main_vendor.js',
1474
    },
1475 1476 1477 1478
    'module-descriptor-js': {
        'source_filenames': rooted_glob(COMMON_ROOT / 'static/', 'xmodule/descriptors/js/*.js'),
        'output_filename': 'js/lms-module-descriptors.js',
    },
1479
    'module-js': {
1480
        'source_filenames': rooted_glob(COMMON_ROOT / 'static', 'xmodule/modules/js/*.js'),
1481
        'output_filename': 'js/lms-modules.js',
1482
    },
1483 1484
    'discussion': {
        'source_filenames': discussion_js,
1485
        'output_filename': 'js/discussion.js',
1486
    },
Calen Pennington committed
1487
    'staff_grading': {
1488
        'source_filenames': staff_grading_js,
1489
        'output_filename': 'js/staff_grading.js',
1490
    },
Calen Pennington committed
1491
    'open_ended': {
1492
        'source_filenames': open_ended_js,
1493
        'output_filename': 'js/open_ended.js',
Arthur Barrett committed
1494 1495 1496
    },
    'notes': {
        'source_filenames': notes_js,
1497
        'output_filename': 'js/notes.js',
Arthur Barrett committed
1498
    },
1499 1500 1501
    'instructor_dash': {
        'source_filenames': instructor_dash_js,
        'output_filename': 'js/instructor_dash.js',
1502
    },
Will Daly committed
1503 1504 1505 1506
    'dashboard': {
        'source_filenames': dashboard_js,
        'output_filename': 'js/dashboard.js'
    },
1507 1508 1509
    'rwd_header': {
        'source_filenames': rwd_header_js,
        'output_filename': 'js/rwd_header.js'
1510
    },
1511 1512 1513 1514 1515 1516 1517
    'student_account': {
        'source_filenames': student_account_js,
        'output_filename': 'js/student_account.js'
    },
    'student_profile': {
        'source_filenames': student_profile_js,
        'output_filename': 'js/student_profile.js'
1518
    },
1519 1520 1521
    'verify_student': {
        'source_filenames': verify_student_js,
        'output_filename': 'js/verify_student.js'
1522 1523 1524 1525
    },
    'reverify': {
        'source_filenames': reverify_js,
        'output_filename': 'js/reverify.js'
1526
    },
cewing committed
1527 1528 1529
    'ccx': {
        'source_filenames': ccx_js,
        'output_filename': 'js/ccx.js'
1530 1531
    },
    'footer_edx': {
1532
        'source_filenames': ['js/footer-edx.js'],
1533 1534 1535 1536 1537
        'output_filename': 'js/footer-edx.js'
    },
    'discovery': {
        'source_filenames': discovery_js,
        'output_filename': 'js/discovery.js'
1538
    }
1539 1540
}

1541 1542
PIPELINE_DISABLE_WRAPPER = True

1543 1544 1545
# Compile all coffee files in course data directories if they are out of date.
# TODO: Remove this once we move data into Mongo. This is only temporary while
# course data directories are still in use.
1546 1547 1548 1549 1550 1551 1552 1553 1554 1555
if os.path.isdir(DATA_DIR):
    for course_dir in os.listdir(DATA_DIR):
        js_dir = DATA_DIR / course_dir / "js"
        if not os.path.isdir(js_dir):
            continue
        for filename in os.listdir(js_dir):
            if filename.endswith('coffee'):
                new_filename = os.path.splitext(filename)[0] + ".js"
                if os.path.exists(js_dir / new_filename):
                    coffee_timestamp = os.stat(js_dir / filename).st_mtime
1556
                    js_timestamp = os.stat(js_dir / new_filename).st_mtime
1557 1558
                    if coffee_timestamp <= js_timestamp:
                        continue
1559
                os.system("rm %s" % (js_dir / new_filename))
1560 1561
                os.system("coffee -c %s" % (js_dir / filename))

1562 1563

PIPELINE_CSS_COMPRESSOR = None
1564
PIPELINE_JS_COMPRESSOR = "pipeline.compressors.uglifyjs.UglifyJSCompressor"
1565

1566
STATICFILES_IGNORE_PATTERNS = (
1567 1568
    "sass/*",
    "coffee/*",
1569 1570 1571 1572

    # Symlinks used by js-test-tool
    "xmodule_js",
    "common_static",
1573 1574
)

1575
PIPELINE_UGLIFYJS_BINARY = 'node_modules/.bin/uglifyjs'
1576

1577
# Setting that will only affect the edX version of django-pipeline until our changes are merged upstream
1578 1579
PIPELINE_COMPILE_INPLACE = True

1580

1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611
################################# CELERY ######################################

# Message configuration

CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'

CELERY_MESSAGE_COMPRESSION = 'gzip'

# Results configuration

CELERY_IGNORE_RESULT = False
CELERY_STORE_ERRORS_EVEN_IF_IGNORED = True

# Events configuration

CELERY_TRACK_STARTED = True

CELERY_SEND_EVENTS = True
CELERY_SEND_TASK_SENT_EVENT = True

# Exchange configuration

CELERY_DEFAULT_EXCHANGE = 'edx.core'
CELERY_DEFAULT_EXCHANGE_TYPE = 'direct'

# Queues configuration

HIGH_PRIORITY_QUEUE = 'edx.core.high'
DEFAULT_PRIORITY_QUEUE = 'edx.core.default'
LOW_PRIORITY_QUEUE = 'edx.core.low'
1612
HIGH_MEM_QUEUE = 'edx.core.high_mem'
1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623

CELERY_QUEUE_HA_POLICY = 'all'

CELERY_CREATE_MISSING_QUEUES = True

CELERY_DEFAULT_QUEUE = DEFAULT_PRIORITY_QUEUE
CELERY_DEFAULT_ROUTING_KEY = DEFAULT_PRIORITY_QUEUE

CELERY_QUEUES = {
    HIGH_PRIORITY_QUEUE: {},
    LOW_PRIORITY_QUEUE: {},
1624 1625
    DEFAULT_PRIORITY_QUEUE: {},
    HIGH_MEM_QUEUE: {},
1626 1627
}

1628 1629 1630 1631 1632
# let logging work as configured:
CELERYD_HIJACK_ROOT_LOGGER = False

################################ Bulk Email ###################################

1633 1634
# Suffix used to construct 'from' email address for bulk emails.
# A course-specific identifier is prepended.
1635
BULK_EMAIL_DEFAULT_FROM_EMAIL = 'no-reply@example.com'
1636 1637 1638

# Parameters for breaking down course enrollment into subtasks.
BULK_EMAIL_EMAILS_PER_TASK = 100
1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651

# Initial delay used for retrying tasks.  Additional retries use
# longer delays.  Value is in seconds.
BULK_EMAIL_DEFAULT_RETRY_DELAY = 30

# Maximum number of retries per task for errors that are not related
# to throttling.
BULK_EMAIL_MAX_RETRIES = 5

# Maximum number of retries per task for errors that are related to
# throttling.  If this is not set, then there is no cap on such retries.
BULK_EMAIL_INFINITE_RETRY_CAP = 1000

1652 1653 1654
# We want Bulk Email running on the high-priority queue, so we define the
# routing key that points to it.  At the moment, the name is the same.
BULK_EMAIL_ROUTING_KEY = HIGH_PRIORITY_QUEUE
1655

1656 1657
# We also define a queue for smaller jobs so that large courses don't block
# smaller emails (see BULK_EMAIL_JOB_SIZE_THRESHOLD setting)
1658
BULK_EMAIL_ROUTING_KEY_SMALL_JOBS = LOW_PRIORITY_QUEUE
1659 1660 1661 1662 1663 1664

# For emails with fewer than these number of recipients, send them through
# a different queue to avoid large courses blocking emails that are meant to be
# sent to self and staff
BULK_EMAIL_JOB_SIZE_THRESHOLD = 100

1665 1666 1667
# Flag to indicate if individual email addresses should be logged as they are sent
# a bulk email message.
BULK_EMAIL_LOG_SENT_EMAILS = False
1668

1669 1670 1671 1672 1673 1674
# Delay in seconds to sleep between individual mail messages being sent,
# when a bulk email task is retried for rate-related reasons.  Choose this
# value depending on the number of workers that might be sending email in
# parallel, and what the SES rate is.
BULK_EMAIL_RETRY_DELAY_BETWEEN_SENDS = 0.02

1675 1676 1677
############################# Email Opt In ####################################

# Minimum age for organization-wide email opt in
1678
EMAIL_OPTIN_MINIMUM_AGE = PARENTAL_CONSENT_AGE_LIMIT
1679

1680 1681
############################## Video ##########################################

1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697
YOUTUBE = {
    # YouTube JavaScript API
    'API': 'www.youtube.com/iframe_api',

    # URL to test YouTube availability
    'TEST_URL': 'gdata.youtube.com/feeds/api/videos/',

    # Current youtube api for requesting transcripts.
    # For example: http://video.google.com/timedtext?lang=en&v=j_jEn79vS3g.
    'TEXT_API': {
        'url': 'video.google.com/timedtext',
        'params': {
            'lang': 'en',
            'v': 'set_youtube_id_of_11_symbols_here',
        },
    },
Alexander Kryklia committed
1698 1699

    'IMAGE_API': 'http://img.youtube.com/vi/{youtube_id}/0.jpg',  # /maxresdefault.jpg for 1920*1080
1700
}
1701

1702
################################### APPS ######################################
1703 1704 1705 1706 1707 1708 1709 1710
INSTALLED_APPS = (
    # Standard ones that are always installed...
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.humanize',
    'django.contrib.messages',
    'django.contrib.sessions',
    'django.contrib.sites',
1711
    'djcelery',
1712 1713
    'south',

1714 1715 1716
    # Database-backed configuration
    'config_models',

1717 1718 1719
    # Monitor the status of services
    'service_status',

1720
    # For asset pipelining
David Baumgold committed
1721
    'edxmako',
1722 1723
    'pipeline',
    'staticfiles',
1724
    'static_replace',
1725

1726 1727 1728 1729
    # Our courseware
    'circuit',
    'courseware',
    'student',
1730

1731 1732 1733
    'static_template_view',
    'staticbook',
    'track',
1734
    'eventtracking.django',
1735
    'util',
1736
    'certificates',
Carson Gee committed
1737
    'dashboard',
1738
    'instructor',
1739
    'instructor_task',
1740
    'open_ended_grading',
1741
    'psychometrics',
1742
    'licenses',
1743
    'openedx.core.djangoapps.course_groups',
1744
    'bulk_email',
1745
    'branding',
1746

1747 1748 1749 1750
    # External auth (OpenID, shib)
    'external_auth',
    'django_openid_auth',

1751 1752 1753 1754 1755
    # OAuth2 Provider
    'provider',
    'provider.oauth2',
    'oauth2_provider',

1756
    'auth_exchange',
1757

1758
    # For the wiki
1759
    'wiki',  # The new django-wiki from benjaoming
1760
    'django_notify',
1761
    'course_wiki',  # Our customizations
1762 1763
    'mptt',
    'sekizai',
1764
    #'wiki.plugins.attachments',
1765
    'wiki.plugins.links',
1766
    'wiki.plugins.notifications',
1767
    'course_wiki.plugins.markdownedx',
1768

1769
    # Foldit integration
Victor Shnayder committed
1770 1771
    'foldit',

1772
    # For testing
1773
    'django.contrib.admin',  # only used in DEBUG mode
1774
    'django_nose',
1775
    'debug',
1776

1777
    # Discussion forums
1778
    'django_comment_client',
1779
    'django_comment_common',
Greg Price committed
1780
    'discussion_api',
1781
    'notes',
1782

1783 1784
    'edxnotes',

1785 1786 1787
    # Splash screen
    'splash',

1788 1789 1790
    # Monitoring
    'datadog',

1791 1792
    # User API
    'rest_framework',
1793
    'openedx.core.djangoapps.user_api',
1794

1795 1796 1797
    # Team API
    'teams',

1798
    # Shopping cart
1799 1800
    'shoppingcart',

1801 1802
    # Notification preferences setting
    'notification_prefs',
1803

1804 1805
    'notifier_api',

1806
    # Different Course Modes
1807
    'course_modes',
1808

1809 1810 1811
    # Enrollment API
    'enrollment',

1812 1813
    # Student Identity Verification
    'verify_student',
1814 1815 1816

    # Dark-launching languages
    'dark_lang',
1817 1818

    # Microsite configuration
1819
    'microsite_configuration',
1820 1821 1822

    # Student Identity Reverification
    'reverification',
1823 1824

    'embargo',
1825 1826 1827

    # Monitoring functionality
    'monitoring',
1828 1829

    # Course action state
Chris Rossi committed
1830 1831 1832 1833
    'course_action_state',

    # Additional problem types
    'edx_jsme',    # Molecular Structure
1834 1835

    # Country list
1836 1837 1838 1839
    'django_countries',

    # edX Mobile API
    'mobile_api',
1840 1841 1842

    # Surveys
    'survey',
1843 1844

    'lms.djangoapps.lms_xblock',
1845 1846

    'openedx.core.djangoapps.content.course_structures',
1847
    'course_structure_api',
Will Daly committed
1848

1849 1850 1851
    # Mailchimp Syncing
    'mailing',

Will Daly committed
1852 1853
    # CORS and cross-domain CSRF
    'corsheaders',
1854 1855 1856
    'cors_csrf',

    'commerce',
1857 1858 1859

    # Credit courses
    'openedx.core.djangoapps.credit',
Diana Huang committed
1860 1861 1862

    # Course teams
    'teams',
1863
)
1864

Will Daly committed
1865 1866 1867 1868 1869 1870
######################### CSRF #########################################

# Forwards-compatibility with Django 1.7
CSRF_COOKIE_AGE = 60 * 60 * 24 * 7 * 52


1871 1872
######################### MARKETING SITE ###############################
EDXMKTG_COOKIE_NAME = 'edxloggedin'
1873
MKTG_URLS = {}
1874
MKTG_URL_LINK_MAP = {
1875
    'ABOUT': 'about',
1876
    'CONTACT': 'contact',
1877
    'FAQ': 'help',
1878 1879
    'COURSES': 'courses',
    'ROOT': 'root',
1880
    'TOS': 'tos',
1881
    'HONOR': 'honor',  # If your site does not have an honor code, simply delete this line.
1882
    'PRIVACY': 'privacy',
1883
    'PRESS': 'press',
1884
    'BLOG': 'blog',
1885
    'DONATE': 'donate',
1886 1887

    # Verified Certificates
1888
    'WHAT_IS_VERIFIED_CERT': 'verified-certificate',
1889
}
1890

1891 1892 1893
################# Social Media Footer Links #######################
# The names list controls the order of social media
# links in the footer.
1894 1895 1896 1897 1898 1899 1900 1901
SOCIAL_MEDIA_FOOTER_NAMES = [
    "facebook",
    "twitter",
    "youtube",
    "linkedin",
    "google_plus",
    "reddit",
]
1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937

# The footer URLs dictionary maps social footer names
# to URLs defined in configuration.
SOCIAL_MEDIA_FOOTER_URLS = {}

# The display dictionary defines the title
# and icon class for each social media link.
SOCIAL_MEDIA_FOOTER_DISPLAY = {
    "facebook": {
        # Translators: This is the website name of www.facebook.com.  Please
        # translate this the way that Facebook advertises in your language.
        "title": _("Facebook"),
        "icon": "fa-facebook-square"
    },
    "twitter": {
        # Translators: This is the website name of www.twitter.com.  Please
        # translate this the way that Twitter advertises in your language.
        "title": _("Twitter"),
        "icon": "fa-twitter"
    },
    "linkedin": {
        # Translators: This is the website name of www.linkedin.com.  Please
        # translate this the way that LinkedIn advertises in your language.
        "title": _("LinkedIn"),
        "icon": "fa-linkedin-square"
    },
    "google_plus": {
        # Translators: This is the website name of plus.google.com.  Please
        # translate this the way that Google+ advertises in your language.
        "title": _("Google+"),
        "icon": "fa-google-plus-square"
    },
    "tumblr": {
        # Translators: This is the website name of www.tumblr.com.  Please
        # translate this the way that Tumblr advertises in your language.
        "title": _("Tumblr"),
1938
        "icon": "fa-tumblr"
1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949
    },
    "meetup": {
        # Translators: This is the website name of www.meetup.com.  Please
        # translate this the way that MeetUp advertises in your language.
        "title": _("Meetup"),
        "icon": "fa-calendar"
    },
    "reddit": {
        # Translators: This is the website name of www.reddit.com.  Please
        # translate this the way that Reddit advertises in your language.
        "title": _("Reddit"),
1950
        "icon": "fa-reddit"
1951
    },
1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963
    "vk": {
        # Translators: This is the website name of https://vk.com.  Please
        # translate this the way that VK advertises in your language.
        "title": _("VK"),
        "icon": "fa-vk"
    },
    "weibo": {
        # Translators: This is the website name of http://www.weibo.com.  Please
        # translate this the way that Weibo advertises in your language.
        "title": _("Weibo"),
        "icon": "fa-weibo"
    },
1964 1965 1966 1967
    "youtube": {
        # Translators: This is the website name of www.youtube.com.  Please
        # translate this the way that YouTube advertises in your language.
        "title": _("Youtube"),
1968
        "icon": "fa-youtube"
1969 1970 1971
    }
}

1972 1973 1974 1975 1976 1977 1978
################# Mobile URLS ##########################

# These are URLs to the app store for mobile.
MOBILE_STORE_URLS = {
    'apple': '#',
    'google': '#'
}
1979

1980 1981
################# Student Verification #################
VERIFY_STUDENT = {
1982
    "DAYS_GOOD_FOR": 365,  # How many days is a verficiation good for?
1983
}
1984

1985 1986 1987 1988 1989
### This enables the Metrics tab for the Instructor dashboard ###########
FEATURES['CLASS_DASHBOARD'] = False
if FEATURES.get('CLASS_DASHBOARD'):
    INSTALLED_APPS += ('class_dashboard',)

1990 1991
######################## CAS authentication ###########################

1992
if FEATURES.get('AUTH_USE_CAS'):
1993 1994 1995 1996
    CAS_SERVER_URL = 'https://provide_your_cas_url_here'
    AUTHENTICATION_BACKENDS = (
        'django.contrib.auth.backends.ModelBackend',
        'django_cas.backends.CASBackend',
1997
    )
1998 1999
    INSTALLED_APPS += ('django_cas',)
    MIDDLEWARE_CLASSES += ('django_cas.middleware.CASMiddleware',)
2000

2001
############# Cross-domain requests #################
2002 2003 2004 2005

if FEATURES.get('ENABLE_CORS_HEADERS'):
    CORS_ALLOW_CREDENTIALS = True
    CORS_ORIGIN_WHITELIST = ()
2006
    CORS_ORIGIN_ALLOW_ALL = False
2007

2008 2009 2010 2011 2012
# Default cache expiration for the cross-domain proxy HTML page.
# This is a static page that can be iframed into an external page
# to simulate cross-domain requests.
XDOMAIN_PROXY_CACHE_TIMEOUT = 60 * 15

2013 2014
###################### Registration ##################################

2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026
# For each of the fields, give one of the following values:
# - 'required': to display the field, and make it mandatory
# - 'optional': to display the field, and make it non-mandatory
# - 'hidden': to not display the field

REGISTRATION_EXTRA_FIELDS = {
    'level_of_education': 'optional',
    'gender': 'optional',
    'year_of_birth': 'optional',
    'mailing_address': 'optional',
    'goals': 'optional',
    'honor_code': 'required',
2027
    'terms_of_service': 'hidden',
2028 2029 2030
    'city': 'hidden',
    'country': 'hidden',
}
2031

2032 2033 2034 2035
########################## CERTIFICATE NAME ########################
CERT_NAME_SHORT = "Certificate"
CERT_NAME_LONG = "Certificate of Achievement"

2036 2037 2038 2039 2040 2041 2042
#################### Badgr OpenBadges generation #######################
# Be sure to set up images for course modes using the BadgeImageConfiguration model in the certificates app.
BADGR_API_TOKEN = None
# Do not add the trailing slash here.
BADGR_BASE_URL = "http://localhost:8005"
BADGR_ISSUER_SLUG = "example-issuer"

2043
###################### Grade Downloads ######################
2044 2045 2046
GRADES_DOWNLOAD_ROUTING_KEY = HIGH_MEM_QUEUE

GRADES_DOWNLOAD = {
2047 2048 2049
    'STORAGE_TYPE': 'localfs',
    'BUCKET': 'edx-grades',
    'ROOT_PATH': '/tmp/edx-s3/grades',
2050
}
2051

2052 2053 2054 2055 2056 2057
FINANCIAL_REPORTS = {
    'STORAGE_TYPE': 'localfs',
    'BUCKET': 'edx-financial-reports',
    'ROOT_PATH': '/tmp/edx-s3/financial_reports',
}

2058

2059
#### PASSWORD POLICY SETTINGS #####
2060
PASSWORD_MIN_LENGTH = 8
2061
PASSWORD_MAX_LENGTH = None
2062
PASSWORD_COMPLEXITY = {"UPPER": 1, "LOWER": 1, "DIGITS": 1}
2063 2064 2065
PASSWORD_DICTIONARY_EDIT_DISTANCE_THRESHOLD = None
PASSWORD_DICTIONARY = []

2066 2067 2068 2069
##################### LinkedIn #####################
INSTALLED_APPS += ('django_openid_auth',)


2070 2071 2072 2073 2074
############################ ORA 2 ############################################

# By default, don't use a file prefix
ORA2_FILE_PREFIX = None

Stephen Sanchez committed
2075 2076 2077
# Default File Upload Storage bucket and prefix. Used by the FileUpload Service.
FILE_UPLOAD_STORAGE_BUCKET_NAME = 'edxuploads'
FILE_UPLOAD_STORAGE_PREFIX = 'submissions_attachments'
2078

2079 2080 2081
##### ACCOUNT LOCKOUT DEFAULT PARAMETERS #####
MAX_FAILED_LOGIN_ATTEMPTS_ALLOWED = 5
MAX_FAILED_LOGIN_ATTEMPTS_LOCKOUT_PERIOD_SECS = 15 * 60
2082 2083 2084 2085


##### LMS DEADLINE DISPLAY TIME_ZONE #######
TIME_ZONE_DISPLAYED_FOR_DEADLINES = 'UTC'
2086 2087 2088 2089


# Source:
# http://loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt according to http://en.wikipedia.org/wiki/ISO_639-1
2090 2091
# Note that this is used as the set of choices to the `code` field of the
# `LanguageProficiency` model.
2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117
ALL_LANGUAGES = (
    [u"aa", u"Afar"],
    [u"ab", u"Abkhazian"],
    [u"af", u"Afrikaans"],
    [u"ak", u"Akan"],
    [u"sq", u"Albanian"],
    [u"am", u"Amharic"],
    [u"ar", u"Arabic"],
    [u"an", u"Aragonese"],
    [u"hy", u"Armenian"],
    [u"as", u"Assamese"],
    [u"av", u"Avaric"],
    [u"ae", u"Avestan"],
    [u"ay", u"Aymara"],
    [u"az", u"Azerbaijani"],
    [u"ba", u"Bashkir"],
    [u"bm", u"Bambara"],
    [u"eu", u"Basque"],
    [u"be", u"Belarusian"],
    [u"bn", u"Bengali"],
    [u"bh", u"Bihari languages"],
    [u"bi", u"Bislama"],
    [u"bs", u"Bosnian"],
    [u"br", u"Breton"],
    [u"bg", u"Bulgarian"],
    [u"my", u"Burmese"],
2118
    [u"ca", u"Catalan"],
2119 2120 2121
    [u"ch", u"Chamorro"],
    [u"ce", u"Chechen"],
    [u"zh", u"Chinese"],
2122 2123
    [u"zh_HANS", u"Simplified Chinese"],
    [u"zh_HANT", u"Traditional Chinese"],
2124
    [u"cu", u"Church Slavic"],
2125 2126 2127 2128 2129 2130
    [u"cv", u"Chuvash"],
    [u"kw", u"Cornish"],
    [u"co", u"Corsican"],
    [u"cr", u"Cree"],
    [u"cs", u"Czech"],
    [u"da", u"Danish"],
2131 2132
    [u"dv", u"Divehi"],
    [u"nl", u"Dutch"],
2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145
    [u"dz", u"Dzongkha"],
    [u"en", u"English"],
    [u"eo", u"Esperanto"],
    [u"et", u"Estonian"],
    [u"ee", u"Ewe"],
    [u"fo", u"Faroese"],
    [u"fj", u"Fijian"],
    [u"fi", u"Finnish"],
    [u"fr", u"French"],
    [u"fy", u"Western Frisian"],
    [u"ff", u"Fulah"],
    [u"ka", u"Georgian"],
    [u"de", u"German"],
2146
    [u"gd", u"Gaelic"],
2147 2148 2149
    [u"ga", u"Irish"],
    [u"gl", u"Galician"],
    [u"gv", u"Manx"],
2150
    [u"el", u"Greek"],
2151 2152
    [u"gn", u"Guarani"],
    [u"gu", u"Gujarati"],
2153
    [u"ht", u"Haitian"],
2154 2155 2156 2157 2158 2159 2160 2161 2162 2163
    [u"ha", u"Hausa"],
    [u"he", u"Hebrew"],
    [u"hz", u"Herero"],
    [u"hi", u"Hindi"],
    [u"ho", u"Hiri Motu"],
    [u"hr", u"Croatian"],
    [u"hu", u"Hungarian"],
    [u"ig", u"Igbo"],
    [u"is", u"Icelandic"],
    [u"io", u"Ido"],
2164
    [u"ii", u"Sichuan Yi"],
2165
    [u"iu", u"Inuktitut"],
2166 2167
    [u"ie", u"Interlingue"],
    [u"ia", u"Interlingua"],
2168 2169 2170 2171 2172
    [u"id", u"Indonesian"],
    [u"ik", u"Inupiaq"],
    [u"it", u"Italian"],
    [u"jv", u"Javanese"],
    [u"ja", u"Japanese"],
2173
    [u"kl", u"Kalaallisut"],
2174 2175 2176 2177 2178
    [u"kn", u"Kannada"],
    [u"ks", u"Kashmiri"],
    [u"kr", u"Kanuri"],
    [u"kk", u"Kazakh"],
    [u"km", u"Central Khmer"],
2179
    [u"ki", u"Kikuyu"],
2180
    [u"rw", u"Kinyarwanda"],
2181
    [u"ky", u"Kirghiz"],
2182 2183 2184
    [u"kv", u"Komi"],
    [u"kg", u"Kongo"],
    [u"ko", u"Korean"],
2185
    [u"kj", u"Kuanyama"],
2186 2187 2188 2189
    [u"ku", u"Kurdish"],
    [u"lo", u"Lao"],
    [u"la", u"Latin"],
    [u"lv", u"Latvian"],
2190
    [u"li", u"Limburgan"],
2191 2192
    [u"ln", u"Lingala"],
    [u"lt", u"Lithuanian"],
2193
    [u"lb", u"Luxembourgish"],
2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205
    [u"lu", u"Luba-Katanga"],
    [u"lg", u"Ganda"],
    [u"mk", u"Macedonian"],
    [u"mh", u"Marshallese"],
    [u"ml", u"Malayalam"],
    [u"mi", u"Maori"],
    [u"mr", u"Marathi"],
    [u"ms", u"Malay"],
    [u"mg", u"Malagasy"],
    [u"mt", u"Maltese"],
    [u"mn", u"Mongolian"],
    [u"na", u"Nauru"],
2206 2207 2208
    [u"nv", u"Navajo"],
    [u"nr", u"Ndebele, South"],
    [u"nd", u"Ndebele, North"],
2209 2210
    [u"ng", u"Ndonga"],
    [u"ne", u"Nepali"],
2211 2212
    [u"nn", u"Norwegian Nynorsk"],
    [u"nb", u"Bokmål, Norwegian"],
2213
    [u"no", u"Norwegian"],
2214 2215
    [u"ny", u"Chichewa"],
    [u"oc", u"Occitan"],
2216 2217 2218
    [u"oj", u"Ojibwa"],
    [u"or", u"Oriya"],
    [u"om", u"Oromo"],
2219 2220
    [u"os", u"Ossetian"],
    [u"pa", u"Panjabi"],
2221 2222 2223 2224
    [u"fa", u"Persian"],
    [u"pi", u"Pali"],
    [u"pl", u"Polish"],
    [u"pt", u"Portuguese"],
2225
    [u"ps", u"Pushto"],
2226 2227
    [u"qu", u"Quechua"],
    [u"rm", u"Romansh"],
2228
    [u"ro", u"Romanian"],
2229 2230 2231 2232
    [u"rn", u"Rundi"],
    [u"ru", u"Russian"],
    [u"sg", u"Sango"],
    [u"sa", u"Sanskrit"],
2233
    [u"si", u"Sinhala"],
2234 2235 2236 2237 2238 2239 2240 2241
    [u"sk", u"Slovak"],
    [u"sl", u"Slovenian"],
    [u"se", u"Northern Sami"],
    [u"sm", u"Samoan"],
    [u"sn", u"Shona"],
    [u"sd", u"Sindhi"],
    [u"so", u"Somali"],
    [u"st", u"Sotho, Southern"],
2242
    [u"es", u"Spanish"],
2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263
    [u"sc", u"Sardinian"],
    [u"sr", u"Serbian"],
    [u"ss", u"Swati"],
    [u"su", u"Sundanese"],
    [u"sw", u"Swahili"],
    [u"sv", u"Swedish"],
    [u"ty", u"Tahitian"],
    [u"ta", u"Tamil"],
    [u"tt", u"Tatar"],
    [u"te", u"Telugu"],
    [u"tg", u"Tajik"],
    [u"tl", u"Tagalog"],
    [u"th", u"Thai"],
    [u"bo", u"Tibetan"],
    [u"ti", u"Tigrinya"],
    [u"to", u"Tonga (Tonga Islands)"],
    [u"tn", u"Tswana"],
    [u"ts", u"Tsonga"],
    [u"tk", u"Turkmen"],
    [u"tr", u"Turkish"],
    [u"tw", u"Twi"],
2264
    [u"ug", u"Uighur"],
2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276
    [u"uk", u"Ukrainian"],
    [u"ur", u"Urdu"],
    [u"uz", u"Uzbek"],
    [u"ve", u"Venda"],
    [u"vi", u"Vietnamese"],
    [u"vo", u"Volapük"],
    [u"cy", u"Welsh"],
    [u"wa", u"Walloon"],
    [u"wo", u"Wolof"],
    [u"xh", u"Xhosa"],
    [u"yi", u"Yiddish"],
    [u"yo", u"Yoruba"],
2277
    [u"za", u"Zhuang"],
2278 2279
    [u"zu", u"Zulu"]
)
2280 2281


2282 2283 2284
### Apps only installed in some instances
OPTIONAL_APPS = (
    'mentoring',
2285
    'problem_builder',
2286
    'edx_sga',
Will Daly committed
2287 2288 2289 2290 2291

    # edx-ora2
    'submissions',
    'openassessment',
    'openassessment.assessment',
2292
    'openassessment.fileupload',
Will Daly committed
2293
    'openassessment.workflow',
2294 2295 2296
    'openassessment.xblock',

    # edxval
2297
    'edxval',
2298 2299 2300

    # milestones
    'milestones',
2301
)
2302

2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314
for app_name in OPTIONAL_APPS:
    # First attempt to only find the module rather than actually importing it,
    # to avoid circular references - only try to import if it can't be found
    # by find_module, which doesn't work with import hooks
    try:
        imp.find_module(app_name)
    except ImportError:
        try:
            __import__(app_name)
        except ImportError:
            continue
    INSTALLED_APPS += (app_name,)
2315 2316 2317 2318

# Stub for third_party_auth options.
# See common/djangoapps/third_party_auth/settings.py for configuration details.
THIRD_PARTY_AUTH = {}
2319 2320 2321 2322

### ADVANCED_SECURITY_CONFIG
# Empty by default
ADVANCED_SECURITY_CONFIG = {}
2323 2324 2325 2326

### External auth usage -- prefixes for ENROLLMENT_DOMAIN
SHIBBOLETH_DOMAIN_PREFIX = 'shib:'
OPENID_DOMAIN_PREFIX = 'openid:'
2327

2328
### Analytics Data API + Dashboard (Insights) settings
2329 2330
ANALYTICS_DATA_URL = ""
ANALYTICS_DATA_TOKEN = ""
2331
ANALYTICS_DASHBOARD_URL = ""
2332
ANALYTICS_DASHBOARD_NAME = PLATFORM_NAME + " Insights"
2333

2334 2335 2336
# REGISTRATION CODES DISPLAY INFORMATION SUBTITUTIONS IN THE INVOICE ATTACHMENT
INVOICE_CORP_ADDRESS = "Please place your corporate address\nin this configuration"
INVOICE_PAYMENT_INSTRUCTIONS = "This is where you can\nput directions on how people\nbuying registration codes"
2337 2338 2339 2340 2341 2342

# Country code overrides
# Used by django-countries
COUNTRIES_OVERRIDE = {
    "TW": _("Taiwan"),
}
2343 2344 2345 2346 2347 2348 2349 2350

# which access.py permission name to check in order to determine if a course is visible in
# the course catalog. We default this to the legacy permission 'see_exists'.
COURSE_CATALOG_VISIBILITY_PERMISSION = 'see_exists'

# which access.py permission name to check in order to determine if a course about page is
# visible. We default this to the legacy permission 'see_exists'.
COURSE_ABOUT_VISIBILITY_PERMISSION = 'see_exists'
2351 2352 2353

#date format the api will be formatting the datetime values
API_DATE_FORMAT = '%Y-%m-%d'
2354

2355 2356 2357
# Enrollment API Cache Timeout
ENROLLMENT_COURSE_DETAILS_CACHE_TIMEOUT = 60

2358 2359 2360
# for Student Notes we would like to avoid too frequent token refreshes (default is 30 seconds)
if FEATURES['ENABLE_EDXNOTES']:
    OAUTH_ID_TOKEN_EXPIRATION = 60 * 60
2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374

# Configuration used for generating PDF Receipts/Invoices
PDF_RECEIPT_TAX_ID = 'add here'
PDF_RECEIPT_FOOTER_TEXT = 'add your own specific footer text here'
PDF_RECEIPT_DISCLAIMER_TEXT = 'add your own specific disclaimer text here'
PDF_RECEIPT_BILLING_ADDRESS = 'add your own billing address here with appropriate line feed characters'
PDF_RECEIPT_TERMS_AND_CONDITIONS = 'add your own terms and conditions'
PDF_RECEIPT_TAX_ID_LABEL = 'Tax ID'
PDF_RECEIPT_LOGO_PATH = PROJECT_ROOT + '/static/images/openedx-logo-tag.png'
# Height of the Logo in mm
PDF_RECEIPT_LOGO_HEIGHT_MM = 12
PDF_RECEIPT_COBRAND_LOGO_PATH = PROJECT_ROOT + '/static/images/default-theme/logo.png'
# Height of the Co-brand Logo in mm
PDF_RECEIPT_COBRAND_LOGO_HEIGHT_MM = 12
2375 2376

# Use None for the default search engine
2377
SEARCH_ENGINE = None
2378 2379
# Use LMS specific search initializer
SEARCH_INITIALIZER = "lms.lib.courseware_search.lms_search_initializer.LmsSearchInitializer"
2380 2381
# Use the LMS specific result processor
SEARCH_RESULT_PROCESSOR = "lms.lib.courseware_search.lms_result_processor.LmsSearchResultProcessor"
2382 2383
# Use the LMS specific filter generator
SEARCH_FILTER_GENERATOR = "lms.lib.courseware_search.lms_filter_generator.LmsSearchFilterGenerator"
Andy Armstrong committed
2384

2385 2386
### PERFORMANCE EXPERIMENT SETTINGS ###
# CDN experiment/monitoring flags
2387 2388
CDN_VIDEO_URLS = {}

2389 2390 2391
# Page onload event sampling rate (min 0.0, max 1.0)
ONLOAD_BEACON_SAMPLE_RATE = 0.0

2392 2393
# The configuration visibility of account fields.
ACCOUNT_VISIBILITY_CONFIGURATION = {
Andy Armstrong committed
2394 2395
    # Default visibility level for accounts without a specified value
    # The value is one of: 'all_users', 'private'
2396
    "default_visibility": "all_users",
Andy Armstrong committed
2397

2398 2399
    # The list of all fields that can be shared with other users
    "shareable_fields": [
Andy Armstrong committed
2400 2401 2402 2403
        'username',
        'profile_image',
        'country',
        'time_zone',
2404
        'language_proficiencies',
Andy Armstrong committed
2405 2406 2407
        'bio',
    ],

2408
    # The list of account fields that are always public
Andy Armstrong committed
2409 2410 2411 2412 2413
    "public_fields": [
        'username',
        'profile_image',
    ],
}
2414 2415

# E-Commerce API Configuration
2416
ECOMMERCE_PUBLIC_URL_ROOT = None
2417 2418 2419
ECOMMERCE_API_URL = None
ECOMMERCE_API_SIGNING_KEY = None
ECOMMERCE_API_TIMEOUT = 5
2420 2421

# Reverification checkpoint name pattern
2422
CHECKPOINT_PATTERN = r'(?P<checkpoint_name>[^/]+)'
2423 2424 2425 2426 2427 2428

# For the fields override feature
# If using FEATURES['INDIVIDUAL_DUE_DATES'], you should add
# 'courseware.student_field_overrides.IndividualStudentOverrideProvider' to
# this setting.
FIELD_OVERRIDE_PROVIDERS = ()
2429 2430

# PROFILE IMAGE CONFIG
2431
# WARNING: Certain django storage backends do not support atomic
2432
# file overwrites (including the default, OverwriteStorage) - instead
2433 2434 2435 2436
# there are separate calls to delete and then write a new file in the
# storage backend.  This introduces the risk of a race condition
# occurring when a user uploads a new profile image to replace an
# earlier one (the file will temporarily be deleted).
2437 2438 2439 2440 2441 2442 2443
PROFILE_IMAGE_BACKEND = {
    'class': 'storages.backends.overwrite.OverwriteStorage',
    'options': {
        'location': os.path.join(MEDIA_ROOT, 'profile-images/'),
        'base_url': os.path.join(MEDIA_URL, 'profile-images/'),
    },
}
2444
PROFILE_IMAGE_DEFAULT_FILENAME = 'images/default-theme/default-profile'
2445
PROFILE_IMAGE_DEFAULT_FILE_EXTENSION = 'png'
2446 2447 2448 2449 2450
# This secret key is used in generating unguessable URLs to users'
# profile images.  Once it has been set, changing it will make the
# platform unaware of current image URLs, resulting in reverting all
# users' profile images to the default placeholder image.
PROFILE_IMAGE_SECRET_KEY = 'placeholder secret key'
2451 2452
PROFILE_IMAGE_MAX_BYTES = 1024 * 1024
PROFILE_IMAGE_MIN_BYTES = 100
2453 2454 2455

# This is to check the domain in case of preview.
PREVIEW_DOMAIN = 'preview'
2456 2457 2458 2459

# Sets the maximum number of courses listed on the homepage
# If set to None, all courses will be listed on the homepage
HOMEPAGE_COURSE_MAX = None
2460 2461 2462 2463 2464 2465 2466 2467 2468 2469

################################ Settings for Credit Course Requirements ################################
# Initial delay used for retrying tasks.
# Additional retries use longer delays.
# Value is in seconds.
CREDIT_TASK_DEFAULT_RETRY_DELAY = 30

# Maximum number of retries per task for errors that are not related
# to throttling.
CREDIT_TASK_MAX_RETRIES = 5