common.py 63.9 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
import sys
28
import os
29
import imp
30

31
from path import path
32
from warnings import simplefilter
33
from django.utils.translation import ugettext_lazy as _
34

35
from .discussionsettings import *
36
from xmodule.modulestore.modulestore_settings import update_module_store_settings
37
from lms.djangoapps.lms_xblock.mixin import LmsBlockMixin
Calen Pennington committed
38

39
################################### FEATURES ###################################
40
# The display name of the platform to be used in templates/emails/etc.
41
PLATFORM_NAME = "Your Platform Name Here"
42
CC_MERCHANT_NAME = PLATFORM_NAME
43

44
PLATFORM_FACEBOOK_ACCOUNT = "http://www.facebook.com/YourPlatformFacebookAccount"
45 46 47 48 49 50
PLATFORM_TWITTER_ACCOUNT = "@YourPlatformTwitterAccount"
PLATFORM_TWITTER_URL = "https://twitter.com/YourPlatformTwitterAccount"
PLATFORM_MEETUP_URL = "http://www.meetup.com/YourMeetup"
PLATFORM_LINKEDIN_URL = "http://www.linkedin.com/company/YourPlatform"
PLATFORM_GOOGLE_PLUS_URL = "https://plus.google.com/YourGooglePlusAccount/"

51

52
COURSEWARE_ENABLED = True
53
ENABLE_JASMINE = False
54

Arjun Singh committed
55 56 57 58
DISCUSSION_SETTINGS = {
    'MAX_COMMENT_DEPTH': 2,
}

59

60
# Features
61
FEATURES = {
Calen Pennington committed
62 63
    'SAMPLE': False,
    'USE_DJANGO_PIPELINE': True,
64 65

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

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

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

75 76 77
    # When True, will only publicly list courses by the subdomain. Expects you
    # to define COURSE_LISTINGS, a dictionary mapping subdomains to lists of
    # course_ids (see dev_int.py for an example)
Calen Pennington committed
78
    'SUBDOMAIN_COURSE_LISTINGS': False,
79

80 81 82 83 84
    # 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,

85
    'FORCE_UNIVERSITY_DOMAIN': False,  # set this to the university domain to use, as an override to HTTP_HOST
86 87
                                        # set to None to do no university selection

88 89
    # for consistency in user-experience, keep the value of the following 3 settings
    # in sync with the corresponding ones in cms/envs/common.py
90
    'ENABLE_DISCUSSION_SERVICE': True,
91 92
    'ENABLE_TEXTBOOK': True,
    'ENABLE_STUDENT_NOTES': True,  # enables the student notes API and UI.
93

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

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

100
    'ENABLE_DJANGO_ADMIN_SITE': True,  # set true to enable django's admin site, even on prod (e.g. for course ops)
101 102
    'ENABLE_SQL_TRACKING_LOGS': False,
    'ENABLE_LMS_MIGRATION': False,
103
    'ENABLE_MANUAL_GIT_RELOAD': False,
104

105 106
    'ENABLE_MASQUERADE': True,  # allow course staff to change to student view of courseware

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

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

111 112 113
    # extrernal access methods
    'ACCESS_REQUIRE_STAFF_FOR_COURSE': False,
    'AUTH_USE_OPENID': False,
114
    'AUTH_USE_CERTIFICATES': False,
115
    'AUTH_USE_OPENID_PROVIDER': False,
116 117
    # Even though external_auth is in common, shib assumes the LMS views / urls, so it should only be enabled
    # in LMS
118
    'AUTH_USE_SHIB': False,
119
    'AUTH_USE_CAS': False,
120 121 122 123

    # 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,
124

125 126 127
    # Toggles OAuth2 authentication provider
    'ENABLE_OAUTH2_PROVIDER': False,

128 129
    # Can be turned off if course lists need to be hidden. Effects views and templates.
    'COURSES_ARE_BROWSABLE': True,
130

131 132
    # Enables ability to restrict enrollment in specific courses by the user account login method
    'RESTRICT_ENROLL_BY_REG_METHOD': False,
133

134 135 136 137
    # 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.
138 139
    # If False and ENABLE_INSTRUCTOR_EMAIL: Email will be turned on by default
    #   for all Mongo-backed courses.
140
    'REQUIRE_COURSE_EMAIL_AUTH': True,
141

142 143 144 145
    # 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,

146
    # enable analytics server.
147 148
    # WARNING: THIS SHOULD ALWAYS BE SET TO FALSE UNDER NORMAL
    # LMS OPERATION. See analytics.py for details about what
149 150
    # this does.
    'RUN_AS_ANALYTICS_SERVER_ENABLED': False,
151

152 153
    # Flip to True when the YouTube iframe API breaks (again)
    'USE_YOUTUBE_OBJECT_API': False,
154

155
    # Give a UI to show a student's submission history in a problem by the
156
    # Staff Debug tool.
157 158
    'ENABLE_STUDENT_HISTORY_VIEW': True,

159
    # Segment.io for LMS--need to explicitly turn it on for production.
160 161
    'SEGMENT_IO_LMS': False,

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

165 166 167
    # 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,
168 169 170

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

    # Toggle to indicate use of a custom theme
173 174
    'USE_CUSTOM_THEME': False,

175 176
    # Don't autoplay videos for students
    'AUTOPLAY_VIDEOS': False,
177

178 179
    # Enable instructor dash to submit background tasks
    'ENABLE_INSTRUCTOR_BACKGROUND_TASKS': True,
180

181 182 183
    # Enable instructor to assign individual due dates
    'INDIVIDUAL_DUE_DATES': False,

184 185
    # Enable legacy instructor dashboard
    'ENABLE_INSTRUCTOR_LEGACY_DASHBOARD': True,
186 187
    # Is this an edX-owned domain? (used on instructor dashboard)
    'IS_EDX_DOMAIN': False,
188

189 190 191
    # Toggle to enable certificates of courses on dashboard
    'ENABLE_VERIFIED_CERTIFICATES': False,

192 193
    # Allow use of the hint managment instructor view.
    'ENABLE_HINTER_INSTRUCTOR_VIEW': False,
194

195
    # for load testing
196
    'AUTOMATIC_AUTH_FOR_TESTING': False,
197

198 199
    # Toggle to enable chat availability (configured on a per-course
    # basis in Studio)
200
    'ENABLE_CHAT': False,
201 202

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

205
    # Toggle the availability of the shopping cart page
David Ormsbee committed
206
    'ENABLE_SHOPPING_CART': False,
207 208

    # Toggle storing detailed billing information
209
    'STORE_BILLING_INFO': False,
210 211 212

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

    # Automatically approve student identity verification attempts
    'AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING': False,
216 217 218 219

    # Disable instructor dash buttons for downloading course data
    # when enrollment exceeds this number
    'MAX_ENROLLMENT_INSTR_BUTTONS': 200,
220 221 222

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

225 226 227
    # whether to use password policy enforcement or not
    'ENFORCE_PASSWORD_POLICY': False,

228 229
    # Give course staff unrestricted access to grade downloads (if set to False,
    # only edX superusers can perform the downloads)
230
    'ALLOW_COURSE_STAFF_GRADE_DOWNLOADS': False,
Julia Hansbrough committed
231

Julia Hansbrough committed
232
    'ENABLED_PAYMENT_REPORTS': ["refund_report", "itemized_purchase_report", "university_revenue_share", "certificate_status"],
233 234 235

    # Turn off account locking if failed login attempts exceeds a limit
    'ENABLE_MAX_FAILED_LOGIN_ATTEMPTS': False,
236 237 238

    # Hide any Personally Identifiable Information from application logs
    'SQUELCH_PII_IN_LOGS': False,
239

240
    # Toggles the embargo functionality, which enable embargoing for particular courses
241
    'EMBARGO': False,
242

243
    # Toggles the embargo site functionality, which enable embargoing for the whole site
244
    'SITE_EMBARGOED': False,
245

246 247 248 249
    # 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,
250 251 252

    # Turn on/off Microsites feature
    'USE_MICROSITES': False,
253 254 255 256

    # 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,
257 258 259

    # Toggle to enable alternate urls for marketing links
    'ENABLE_MKTG_SITE': False,
260 261 262

    # Prevent concurrent logins per user
    'PREVENT_CONCURRENT_LOGINS': False,
263 264 265

    # Turn off Advanced Security by default
    'ADVANCED_SECURITY': False,
266 267 268 269

    # Show a "Download your certificate" on the Progress page if the lowest
    # nonzero grade cutoff is met
    'SHOW_PROGRESS_SUCCESS_BUTTON': False,
270

271 272 273 274 275
    # 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,

276 277 278 279 280
    # 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.
    'ENABLE_COURSE_SORTING_BY_START_DATE': False,

281
    # Expose Mobile REST API. Note that if you use this, you must also set
282 283 284
    # ENABLE_OAUTH2_PROVIDER to True
    'ENABLE_MOBILE_REST_API': False,

285 286
    # Enable the new dashboard, account, and profile pages
    'ENABLE_NEW_DASHBOARD': False,
asadiqbal08 committed
287

288 289 290
    # Enable the combined login/registration form
    'ENABLE_COMBINED_LOGIN_REGISTRATION': False,

291 292 293
    # Enable organizational email opt-in
    'ENABLE_MKTG_EMAIL_OPT_IN': False,

asadiqbal08 committed
294 295 296 297
    # 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,
298 299

    # Display demographic data on the analytics tab in the instructor dashboard.
300 301 302 303
    'DISPLAY_ANALYTICS_DEMOGRAPHICS': True,

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

    # Separate the verification flow from the payment flow
    'SEPARATE_VERIFICATION_FROM_PAYMENT': False,
307 308
}

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

312 313 314 315 316 317
# 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

318
# Used with XQueue
319
XQUEUE_WAITTIME_BETWEEN_REQUESTS = 5  # seconds
320

321

322
############################# SET PATH INFORMATION #############################
323
PROJECT_ROOT = path(__file__).abspath().dirname().dirname()  # /edx-platform/lms
324 325
REPO_ROOT = PROJECT_ROOT.dirname()
COMMON_ROOT = REPO_ROOT / "common"
326
ENV_ROOT = REPO_ROOT.dirname()  # virtualenv dir /edx-platform is in
327 328 329 330
COURSES_ROOT = ENV_ROOT / "data"

DATA_DIR = COURSES_ROOT

331
# TODO: Remove the rest of the sys.path modification here and in cms/envs/common.py
332
sys.path.append(REPO_ROOT)
333
sys.path.append(PROJECT_ROOT / 'djangoapps')
334
sys.path.append(COMMON_ROOT / 'djangoapps')
335
sys.path.append(COMMON_ROOT / 'lib')
336

337
# For Node.js
338

339
system_node_path = os.environ.get("NODE_PATH", REPO_ROOT / 'node_modules')
340

341 342 343 344 345
node_paths = [
    COMMON_ROOT / "static/js/vendor",
    COMMON_ROOT / "static/coffee/src",
    system_node_path,
]
346
NODE_PATH = ':'.join(node_paths)
347

348 349
# For geolocation ip database
GEOIP_PATH = REPO_ROOT / "common/static/data/geoip/GeoIP.dat"
350
GEOIPV6_PATH = REPO_ROOT / "common/static/data/geoip/GeoIPv6.dat"
351

352
# Where to look for a status message
353
STATUS_MESSAGE_PATH = ENV_ROOT / "status_message.json"
354

355
############################ OpenID Provider  ##################################
356
OPENID_PROVIDER_TRUSTED_ROOTS = ['cs50.net', '*.cs50.net']
357

358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379
############################ 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'
)

380
################################## EDX WEB #####################################
381 382
# This is where we stick our compiled template files. Most of the app uses Mako
# templates
383 384
import tempfile
MAKO_MODULE_DIR = os.path.join(tempfile.gettempdir(), 'mako_lms')
Piotr Mitros committed
385
MAKO_TEMPLATES = {}
386
MAKO_TEMPLATES['main'] = [PROJECT_ROOT / 'templates',
387
                          COMMON_ROOT / 'templates',
388
                          COMMON_ROOT / 'lib' / 'capa' / 'capa' / 'templates',
389
                          COMMON_ROOT / 'djangoapps' / 'pipeline_mako' / 'templates']
Piotr Mitros committed
390

391
# This is where Django Template lookup is defined. There are a few of these
392
# still left lying around.
393
TEMPLATE_DIRS = [
394
    PROJECT_ROOT / "templates",
395 396 397
    COMMON_ROOT / 'templates',
    COMMON_ROOT / 'lib' / 'capa' / 'capa' / 'templates',
    COMMON_ROOT / 'djangoapps' / 'pipeline_mako' / 'templates',
398
]
399 400 401

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.core.context_processors.request',
402
    'django.core.context_processors.static',
403
    'django.contrib.messages.context_processors.messages',
404
    'django.core.context_processors.i18n',
405
    'django.contrib.auth.context_processors.auth',  # this is required for admin
406
    'django.core.context_processors.csrf',
407

408 409 410 411 412
    # Added for django-wiki
    'django.core.context_processors.media',
    'django.core.context_processors.tz',
    'django.contrib.messages.context_processors.messages',
    'sekizai.context_processors.sekizai',
413 414

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

417 418 419
    # Allows the open edX footer to be leveraged in Django Templates.
    'edxmako.shortcuts.open_source_footer_context_processor',

420 421
    # Shoppingcart processor (detects if request.user has a cart)
    'shoppingcart.context_processor.user_has_cart_context_processor',
422 423 424

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

Diana Huang committed
427 428 429 430
# use the ratelimit backend to prevent brute force attacks
AUTHENTICATION_BACKENDS = (
    'ratelimitbackend.backends.RateLimitModelBackend',
)
431
STUDENT_FILEUPLOAD_MAX_SIZE = 4 * 1000 * 1000  # 4 MB
432
MAX_FILEUPLOADS_PER_INPUT = 20
433

434 435
# FIXME:
# We should have separate S3 staged URLs in case we need to make changes to
436
# these assets and test them.
437
LIB_URL = '/static/js/'
438 439 440

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

444 445 446 447
# Configuration option for when we want to grab server error pages
STATIC_GRAB = False
DEV_CONTENT = True

448
EDX_ROOT_URL = ''
449

450 451
LOGIN_REDIRECT_URL = EDX_ROOT_URL + '/accounts/login'
LOGIN_URL = EDX_ROOT_URL + '/accounts/login'
452

453 454 455 456
COURSE_NAME = "6.002_Spring_2012"
COURSE_NUMBER = "6.002x"
COURSE_TITLE = "Circuits and Electronics"

457
### Dark code. Should be enabled in local settings for devel.
458

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

461 462
WIKI_ENABLED = False

463 464
###

465
COURSE_DEFAULT = '6.002x_Fall_2012'
Adam Palay committed
466 467 468 469 470 471 472 473
COURSE_SETTINGS = {
    '6.002x_Fall_2012': {
        'number': '6.002x',
        'title': 'Circuits and Electronics',
        'xmlpath': '6002x/',
        'location': 'i4x://edx/6002xs12/course/6.002x_Fall_2012',
    }
}
474

Victor Shnayder committed
475 476 477
# 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 = []
478

479 480
# 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.
481 482 483 484 485
# 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')
486
COURSE_KEY_REGEX = COURSE_KEY_PATTERN.replace('P<course_key_string>', ':')
487

488 489 490 491
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://?[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+))'

492 493 494 495

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

# FIXME: Should we be doing this truncation?
496
TRACK_MAX_EVENT = 50000
497 498 499 500 501 502 503 504 505 506 507 508

DEBUG_TRACK_LOG = False

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

509 510
# We're already logging events, and we don't want to capture user
# names/passwords.  Heartbeat events are likely not interesting.
511
TRACKING_IGNORE_URL_PATTERNS = [r'^/event', r'^/login', r'^/heartbeat', r'^/segmentio/event']
512 513 514 515 516 517 518 519 520 521 522 523 524 525

EVENT_TRACKING_ENABLED = True
EVENT_TRACKING_BACKENDS = {
    'logger': {
        'ENGINE': 'eventtracking.backends.logger.LoggerBackend',
        'OPTIONS': {
            'name': 'tracking',
            'max_event_size': TRACK_MAX_EVENT,
        }
    }
}
EVENT_TRACKING_PROCESSORS = [
    {
        'ENGINE': 'track.shim.LegacyFieldMappingProcessor'
526 527 528
    },
    {
        'ENGINE': 'track.shim.VideoEventProcessor'
529 530 531
    }
]

532
# Backwards compatibility with ENABLE_SQL_TRACKING_LOGS feature flag.
533
# In the future, adding the backend to TRACKING_BACKENDS should be enough.
534
if FEATURES.get('ENABLE_SQL_TRACKING_LOGS'):
535 536 537 538 539
    TRACKING_BACKENDS.update({
        'sql': {
            'ENGINE': 'track.backends.django.DjangoBackend'
        }
    })
540 541 542 543 544
    EVENT_TRACKING_BACKENDS.update({
        'sql': {
            'ENGINE': 'track.backends.django.DjangoBackend'
        }
    })
545

546
TRACKING_SEGMENTIO_WEBHOOK_SECRET = None
547
TRACKING_SEGMENTIO_ALLOWED_TYPES = ['track']
548
TRACKING_SEGMENTIO_DISALLOWED_SUBSTRING_NAMES = ['.bi.']
549 550 551 552
TRACKING_SEGMENTIO_SOURCE_MAP = {
    'analytics-android': 'mobile',
    'analytics-ios': 'mobile',
}
553

554
######################## GOOGLE ANALYTICS ###########################
555
GOOGLE_ANALYTICS_ACCOUNT = None
556 557
GOOGLE_ANALYTICS_LINKEDIN = 'GOOGLE_ANALYTICS_LINKEDIN_DUMMY'

558 559 560
######################## OPTIMIZELY ###########################
OPTIMIZELY_PROJECT_ID = None

561 562 563
######################## subdomain specific settings ###########################
COURSE_LISTINGS = {}
SUBDOMAIN_BRANDING = {}
564
VIRTUAL_UNIVERSITIES = []
565

Calen Pennington committed
566 567
############# XBlock Configuration ##########

568 569 570 571 572
# Import after sys.path fixup
from xmodule.modulestore.inheritance import InheritanceMixin
from xmodule.modulestore import prefer_xmodules
from xmodule.x_module import XModuleMixin

Calen Pennington committed
573 574
# This should be moved into an XBlock Runtime/Application object
# once the responsibility of XBlock creation is moved out of modulestore - cpennington
575
XBLOCK_MIXINS = (LmsBlockMixin, InheritanceMixin, XModuleMixin)
Calen Pennington committed
576

577 578
# Allow any XBlock in the LMS
XBLOCK_SELECT_FUNCTION = prefer_xmodules
579

580 581
############# ModuleStore Configuration ##########

Nimisha Asthagiri committed
582
MODULESTORE_BRANCH = 'published-only'
583 584 585 586 587
CONTENTSTORE = None
DOC_STORE_CONFIG = {
    'host': 'localhost',
    'db': 'xmodule',
    'collection': 'modulestore',
588 589 590
    # If 'asset_collection' defined, it'll be used
    # as the collection name for asset metadata.
    # Otherwise, a default collection name will be used.
591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615
}
MODULESTORE = {
    'default': {
        'ENGINE': 'xmodule.modulestore.mixed.MixedModuleStore',
        'OPTIONS': {
            'mappings': {},
            'stores': [
                {
                    'NAME': 'draft',
                    'ENGINE': 'xmodule.modulestore.mongo.DraftMongoModuleStore',
                    'DOC_STORE_CONFIG': DOC_STORE_CONFIG,
                    'OPTIONS': {
                        'default_class': 'xmodule.hidden_module.HiddenDescriptor',
                        'fs_root': DATA_DIR,
                        'render_template': 'edxmako.shortcuts.render_to_string',
                    }
                },
                {
                    'NAME': 'xml',
                    'ENGINE': 'xmodule.modulestore.xml.XMLModuleStore',
                    'OPTIONS': {
                        'data_dir': DATA_DIR,
                        'default_class': 'xmodule.hidden_module.HiddenDescriptor',
                    }
                },
616 617 618 619 620 621 622 623 624 625
                {
                    'NAME': 'split',
                    'ENGINE': 'xmodule.modulestore.split_mongo.split_draft.DraftVersioningModuleStore',
                    'DOC_STORE_CONFIG': DOC_STORE_CONFIG,
                    'OPTIONS': {
                        'default_class': 'xmodule.hidden_module.HiddenDescriptor',
                        'fs_root': DATA_DIR,
                        'render_template': 'edxmako.shortcuts.render_to_string',
                    }
                },
626 627 628 629 630
            ]
        }
    }
}

631 632 633 634 635 636 637
#################### 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',
638 639 640 641 642 643

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

646 647 648 649 650 651 652 653 654
# 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 = []
655

656 657 658 659
############################### DJANGO BUILT-INS ###############################
# Change DEBUG/TEMPLATE_DEBUG in your environment settings files, not here
DEBUG = False
TEMPLATE_DEBUG = False
660
USE_TZ = True
661
SESSION_COOKIE_SECURE = False
662

663 664 665
# CMS base
CMS_BASE = 'localhost:8001'

666 667
# Site info
SITE_ID = 1
668
SITE_NAME = "example.com"
669
HTTPS = 'on'
670
ROOT_URLCONF = 'lms.urls'
671
# NOTE: Please set ALLOWED_HOSTS to some sane value, as we do not allow the default '*'
672

673
# Platform Email
674
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
675 676 677 678 679 680
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'
681 682
UNIVERSITY_EMAIL = 'university@example.com'
PRESS_EMAIL = 'press@example.com'
683
FINANCE_EMAIL = ''
684
ADMINS = ()
685 686
MANAGERS = ADMINS

687
# Static content
688
STATIC_URL = '/static/'
689
STATIC_ROOT = ENV_ROOT / "staticfiles"
690

691
STATICFILES_DIRS = [
692
    COMMON_ROOT / "static",
693
    PROJECT_ROOT / "static",
694
]
695

696 697
FAVICON_PATH = 'images/favicon.ico'

698
# Locale/Internationalization
699 700
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
701
# these languages display right to left
702
LANGUAGES_BIDI = ("en@rtl", "he", "ar", "fa", "ur", "fa-ir")
703

704
# Sourced from http://www.localeplanet.com/icu/ and wikipedia
705
LANGUAGES = (
706
    ('en', u'English'),
707 708
    ('en@rtl', u'English (right-to-left)'),
    ('eo', u'Dummy Language (Esperanto)'),  # Dummy languaged used for testing
709
    ('fake2', u'Fake translations'),        # Another dummy language for testing (not pushed to prod)
710

Sarina Canelake committed
711
    ('am', u'አማርኛ'),  # Amharic
712
    ('ar', u'العربية'),  # Arabic
713 714 715
    ('az', u'azərbaycanca'),  # Azerbaijani
    ('bg-bg', u'български (България)'),  # Bulgarian (Bulgaria)
    ('bn-bd', u'বাংলা (বাংলাদেশ)'),  # Bengali (Bangladesh)
Sarina Canelake committed
716
    ('bn-in', u'বাংলা (ভারত)'),  # Bengali (India)
717
    ('bs', u'bosanski'),  # Bosnian
718
    ('ca', u'Català'),  # Catalan
719
    ('ca@valencia', u'Català (València)'),  # Catalan (Valencia)
720
    ('cs', u'Čeština'),  # Czech
721
    ('cy', u'Cymraeg'),  # Welsh
Sarina Canelake committed
722
    ('da', u'dansk'),  # Danish
723
    ('de-de', u'Deutsch (Deutschland)'),  # German (Germany)
724
    ('el', u'Ελληνικά'),  # Greek
725
    ('en-uk', u'English (United Kingdom)'),  # English (United Kingdom)
726 727 728
    ('en@lolcat', u'LOLCAT English'),  # LOLCAT English
    ('en@pirate', u'Pirate English'),  # Pirate English
    ('es-419', u'Español (Latinoamérica)'),  # Spanish (Latin America)
729 730
    ('es-ar', u'Español (Argentina)'),  # Spanish (Argentina)
    ('es-ec', u'Español (Ecuador)'),  # Spanish (Ecuador)
731
    ('es-es', u'Español (España)'),  # Spanish (Spain)
732 733 734 735 736 737 738
    ('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)
739
    ('fil', u'Filipino'),  # Filipino
740
    ('fr', u'Français'),  # French
741
    ('gl', u'Galego'),  # Galician
Sarina Canelake committed
742
    ('gu', u'ગુજરાતી'),  # Gujarati
743
    ('he', u'עברית'),  # Hebrew
744
    ('hi', u'हिन्दी'),  # Hindi
Sarina Canelake committed
745
    ('hr', u'hrvatski'),  # Croatian
746
    ('hu', u'magyar'),  # Hungarian
747
    ('hy-am', u'Հայերեն (Հայաստան)'),  # Armenian (Armenia)
748 749
    ('id', u'Bahasa Indonesia'),  # Indonesian
    ('it-it', u'Italiano (Italia)'),  # Italian (Italy)
Sarina Canelake committed
750
    ('ja-jp', u'日本語 (日本)'),  # Japanese (Japan)
751 752
    ('kk-kz', u'қазақ тілі (Қазақстан)'),  # Kazakh (Kazakhstan)
    ('km-kh', u'ភាសាខ្មែរ (កម្ពុជា)'),  # Khmer (Cambodia)
Sarina Canelake committed
753
    ('kn', u'ಕನ್ನಡ'),  # Kannada
Sarina Canelake committed
754
    ('ko-kr', u'한국어 (대한민국)'),  # Korean (Korea)
755
    ('lt-lt', u'Lietuvių (Lietuva)'),  # Lithuanian (Lithuania)
756 757
    ('ml', u'മലയാളം'),  # Malayalam
    ('mn', u'Монгол хэл'),  # Mongolian
758
    ('mr', u'मराठी'),  # Marathi
759
    ('ms', u'Bahasa Melayu'),  # Malay
760
    ('nb', u'Norsk bokmål'),  # Norwegian Bokmål
761
    ('ne', u'नेपाली'),  # Nepali
762
    ('nl-nl', u'Nederlands (Nederland)'),  # Dutch (Netherlands)
Sarina Canelake committed
763
    ('or', u'ଓଡ଼ିଆ'),  # Oriya
764 765
    ('pl', u'Polski'),  # Polish
    ('pt-br', u'Português (Brasil)'),  # Portuguese (Brazil)
766
    ('pt-pt', u'Português (Portugal)'),  # Portuguese (Portugal)
Sarina Canelake committed
767
    ('ro', u'română'),  # Romanian
768 769 770
    ('ru', u'Русский'),  # Russian
    ('si', u'සිංහල'),  # Sinhala
    ('sk', u'Slovenčina'),  # Slovak
771
    ('sl', u'Slovenščina'),  # Slovenian
772
    ('sq', u'shqip'),  # Albanian
773
    ('sr', u'Српски'),  # Serbian
774 775
    ('sv', u'svenska'),  # Swedish
    ('sw', u'Kiswahili'),  # Swahili
Sarina Canelake committed
776
    ('ta', u'தமிழ்'),  # Tamil
777
    ('te', u'తెలుగు'),  # Telugu
778
    ('th', u'ไทย'),  # Thai
779
    ('tr-tr', u'Türkçe (Türkiye)'),  # Turkish (Turkey)
780
    ('uk', u'Українська'),  # Ukranian
781
    ('ur', u'اردو'),  # Urdu
782
    ('vi', u'Tiếng Việt'),  # Vietnamese
783
    ('uz', u'Ўзбек'),  # Uzbek
Sarina Canelake committed
784
    ('zh-cn', u'中文 (简体)'),  # Chinese (China)
785
    ('zh-hk', u'中文 (香港)'),  # Chinese (Hong Kong)
Sarina Canelake committed
786
    ('zh-tw', u'中文 (台灣)'),  # Chinese (Taiwan)
787 788
)

789 790
LANGUAGE_DICT = dict(LANGUAGES)

791
USE_I18N = True
792
USE_L10N = True
793

794 795
# Localization strings (e.g. django.po) are under this directory
LOCALE_PATHS = (REPO_ROOT + '/conf/locale',)  # edx-platform/conf/locale/
796 797 798
# Messages
MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'

799 800 801
# Guidelines for translators
TRANSLATORS_GUIDE = 'https://github.com/edx/edx-platform/blob/master/docs/en_us/developers/source/i18n_translators_guide.rst'

802 803 804 805
#################################### 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.
806
# These are listed, eg at https://github.com/edx/edx-platform/admin/hooks
807

808
ALLOWED_GITRELOAD_IPS = ['207.97.227.253', '50.57.128.197', '108.171.174.178']
809

810
#################################### AWS #######################################
811
# S3BotoStorage insists on a timeout for uploaded assets. We should make it
812
# permanent instead, but rather than trying to figure out exactly where that
813
# setting is, I'm just bumping the expiration time to something absurd (100
814 815
# years). This is only used if DEFAULT_FILE_STORAGE is overriden to use S3
# in the global settings.py
816
AWS_QUERYSTRING_EXPIRE = 10 * 365 * 24 * 60 * 60  # 10 years
817

818
################################# SIMPLEWIKI ###################################
819 820
SIMPLE_WIKI_REQUIRE_LOGIN_EDIT = True
SIMPLE_WIKI_REQUIRE_LOGIN_VIEW = False
821

822
################################# WIKI ###################################
823 824
from course_wiki import settings as course_wiki_settings

825
WIKI_ACCOUNT_HANDLING = False
826
WIKI_EDITOR = 'course_wiki.editors.CodeMirror'
827 828
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
829 830 831 832 833

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
834 835

WIKI_USE_BOOTSTRAP_SELECT_WIDGET = False
836
WIKI_LINK_LIVE_LOOKUPS = False
837
WIKI_LINK_DEFAULT_LEVEL = 2
838

839 840 841 842 843 844 845 846
##### Feedback submission mechanism #####
FEEDBACK_SUBMISSION_EMAIL = None

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

847 848 849
##### EMBARGO #####
EMBARGO_SITE_REDIRECT_URL = None

850
##### shoppingcart Payment #####
851
PAYMENT_SUPPORT_EMAIL = 'payment@example.com'
852

853
##### Using cybersource by default #####
854 855

CC_PROCESSOR_NAME = 'CyberSource'
856
CC_PROCESSOR = {
857
    'CyberSource': {
858
        'SHARED_SECRET': '',
859 860
        'MERCHANT_ID': '',
        'SERIAL_NUMBER': '',
861 862
        'ORDERPAGE_VERSION': '7',
        'PURCHASE_ENDPOINT': '',
863 864 865 866 867 868
    },
    'CyberSource2': {
        "PURCHASE_ENDPOINT": '',
        "SECRET_KEY": '',
        "ACCESS_KEY": '',
        "PROFILE_ID": '',
869
    }
870
}
871

872 873
# Setting for PAID_COURSE_REGISTRATION, DOES NOT AFFECT VERIFIED STUDENTS
PAID_COURSE_REGISTRATION_CURRENCY = ['usd', '$']
874 875 876 877

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

878
################################# open ended grading config  #####################
879 880 881

#By setting up the default settings with an incorrect user name and password,
# will get an error when attempting to connect
882
OPEN_ENDED_GRADING_INTERFACE = {
883
    'url': 'http://example.com/peer_grading',
884 885
    'username': 'incorrect_user',
    'password': 'incorrect_pass',
Diana Huang committed
886 887 888 889
    'staff_grading': 'staff_grading',
    'peer_grading': 'peer_grading',
    'grading_controller': 'grading_controller'
}
890

891
# Used for testing, debugging peer grading
892
MOCK_PEER_GRADING = False
893

894 895 896
# Used for testing, debugging staff grading
MOCK_STAFF_GRADING = False

897
################################# Jasmine ##################################
898
JASMINE_TEST_DIRECTORY = PROJECT_ROOT + '/static/coffee'
899

900 901 902 903 904
################################# Deprecation warnings #####################

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

905 906 907 908
################################# Middleware ###################################
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
909 910
    'staticfiles.finders.FileSystemFinder',
    'staticfiles.finders.AppDirectoriesFinder',
Will Daly committed
911
    'pipeline.finders.PipelineFinder',
912 913 914 915
)

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

919 920
    # 'django.template.loaders.filesystem.Loader',
    # 'django.template.loaders.app_directories.Loader',
921

922 923 924
)

MIDDLEWARE_CLASSES = (
925
    'request_cache.middleware.RequestCache',
926
    'microsite_configuration.middleware.MicrositeMiddleware',
Rocky Duan committed
927
    'django_comment_client.middleware.AjaxExceptionMiddleware',
928 929
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
930 931

    # Instead of AuthenticationMiddleware, we use a cached backed version
932 933
    #'django.contrib.auth.middleware.AuthenticationMiddleware',
    'cache_toolbox.middleware.CacheBackedAuthenticationMiddleware',
934
    'student.middleware.UserStandingMiddleware',
935
    'contentserver.middleware.StaticContentServer',
936
    'crum.CurrentRequestUserMiddleware',
937

938 939
    # Adds user tags to tracking events
    # Must go before TrackMiddleware, to get the context set up
940
    'openedx.core.djangoapps.user_api.middleware.UserTagsEventContextMiddleware',
941

942 943
    'django.contrib.messages.middleware.MessageMiddleware',
    'track.middleware.TrackMiddleware',
944
    'django.middleware.csrf.CsrfViewMiddleware',
945
    'splash.middleware.SplashMiddleware',
946

947 948
    # Allows us to dark-launch particular languages
    'dark_lang.middleware.DarkLangMiddleware',
949
    'geoinfo.middleware.CountryMiddleware',
950
    'embargo.middleware.EmbargoMiddleware',
951

952 953
    # Allows us to set user preferences
    # should be after DarkLangMiddleware
954
    'lang_pref.middleware.LanguagePreferenceMiddleware',
955

956 957 958
    # Detects user-requested locale from 'accept-language' header in http request
    'django.middleware.locale.LocaleMiddleware',

959
    'django.middleware.transaction.TransactionMiddleware',
960
    # 'debug_toolbar.middleware.DebugToolbarMiddleware',
961 962

    'django_comment_client.utils.ViewNameMiddleware',
963
    'codejail.django_integration.ConfigureCodeJailMiddleware',
Diana Huang committed
964 965 966

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

970 971
    # for expiring inactive sessions
    'session_inactivity_timeout.middleware.SessionInactivityTimeout',
972

973 974
    # use Django built in clickjacking protection
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
975

976 977 978
    # to redirected unenrolled students to the course info page
    'courseware.middleware.RedirectUnenrolledMiddleware',

979
    'course_wiki.middleware.WikiAccessMiddleware',
980 981
)

982 983 984
# Clickjacking protection can be enabled by setting this to 'DENY'
X_FRAME_OPTIONS = 'ALLOW'

985 986 987 988
############################### Pipeline #######################################

STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'

989
from rooted_paths import rooted_glob
990

991 992
courseware_js = (
    [
993
        'coffee/src/' + pth + '.js'
994 995
        for pth in ['courseware', 'histogram', 'navigation', 'time']
    ] +
996
    ['js/' + pth + '.js' for pth in ['ajax-error']] +
997
    sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/modules/**/*.js'))
998
)
999

1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012

# 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',
1013
    'js/vendor/url.min.js',
1014 1015 1016
    'js/vendor/underscore-min.js',
    'js/vendor/require.js',
    'js/RequireJS-namespace-undefine.js',
1017 1018 1019
]

main_vendor_js = base_vendor_js + [
1020 1021 1022 1023 1024
    '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',
1025
    'js/vendor/URI.min.js',
1026
]
1027

Will Daly committed
1028
dashboard_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'js/dashboard/**/*.js'))
1029
discussion_js = sorted(rooted_glob(COMMON_ROOT / 'static', 'coffee/src/discussion/**/*.js'))
1030
rwd_header_footer_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'js/common_helpers/rwd_header_footer.js'))
1031 1032
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
1033
notes_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/notes/**/*.js'))
1034
instructor_dash_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/instructor_dashboard/**/*.js'))
1035

1036 1037 1038
# 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.
1039
student_account_js = [
1040 1041
    'js/utils/rwd_header_footer.js',
    'js/utils/edx.utils.validate.js',
1042 1043 1044 1045 1046
    'js/form.ext.js',
    'js/my_courses_dropdown.js',
    'js/toggle_login_modal.js',
    'js/sticky_filter.js',
    'js/query-params.js',
1047
    'js/src/utility.js',
1048 1049 1050
    'js/src/accessibility_tools.js',
    'js/src/ie_shim.js',
    'js/src/string_utils.js',
1051
    'js/student_account/enrollment.js',
1052
    'js/student_account/emailoptin.js',
1053
    'js/student_account/shoppingcart.js',
1054
    'js/student_account/models/LoginModel.js',
1055
    'js/student_account/models/RegisterModel.js',
1056
    'js/student_account/models/PasswordResetModel.js',
1057
    'js/student_account/views/FormView.js',
1058
    'js/student_account/views/LoginView.js',
1059
    'js/student_account/views/RegisterView.js',
1060
    'js/student_account/views/PasswordResetView.js',
1061 1062 1063
    'js/student_account/views/AccessView.js',
    'js/student_account/accessApp.js',
]
1064

1065 1066
student_profile_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'js/student_profile/**/*.js'))

1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080
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',
    'js/verify_student/views/webcam_photo_view.js',
    'js/verify_student/views/progress_view.js',
1081
    'js/verify_student/views/requirements_view.js',
1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093
    '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',
]

1094
PIPELINE_CSS = {
1095 1096 1097 1098
    'style-vendor': {
        'source_filenames': [
            'css/vendor/font-awesome.css',
            'css/vendor/jquery.qtip.min.css',
1099 1100
            'css/vendor/responsive-carousel/responsive-carousel.css',
            'css/vendor/responsive-carousel/responsive-carousel.slide.css',
1101 1102
        ],
        'output_filename': 'css/lms-style-vendor.css',
1103
    },
1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115
    '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',
    },
1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127
    'style-app': {
        'source_filenames': [
            'sass/application.css',
            'sass/ie.css'
        ],
        'output_filename': 'css/lms-style-app.css',
    },
    'style-app-extend1': {
        'source_filenames': [
            'sass/application-extend1.css',
        ],
        'output_filename': 'css/lms-style-app-extend1.css',
1128
    },
1129 1130 1131 1132 1133 1134
    'style-app-extend2': {
        'source_filenames': [
            'sass/application-extend2.css',
        ],
        'output_filename': 'css/lms-style-app-extend2.css',
    },
1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153
    'style-app-rtl': {
        'source_filenames': [
            'sass/application-rtl.css',
            'sass/ie-rtl.css'
        ],
        'output_filename': 'css/lms-style-app-rtl.css',
    },
    'style-app-extend1-rtl': {
        'source_filenames': [
            'sass/application-extend1-rtl.css',
        ],
        'output_filename': 'css/lms-style-app-extend1-rtl.css',
    },
    'style-app-extend2-rtl': {
        'source_filenames': [
            'sass/application-extend2-rtl.css',
        ],
        'output_filename': 'css/lms-style-app-extend2-rtl.css',
    },
1154
    'style-course-vendor': {
1155 1156 1157 1158
        'source_filenames': [
            'js/vendor/CodeMirror/codemirror.css',
            'css/vendor/jquery.treeview.css',
            'css/vendor/ui-lightness/jquery-ui-1.8.22.custom.css',
1159 1160 1161 1162 1163
        ],
        'output_filename': 'css/lms-style-course-vendor.css',
    },
    'style-course': {
        'source_filenames': [
1164 1165
            'sass/course.css',
            'xmodule/modules.css',
1166
        ],
1167
        'output_filename': 'css/lms-style-course.css',
1168
    },
1169 1170 1171 1172 1173 1174 1175
    'style-course-rtl': {
        'source_filenames': [
            'sass/course-rtl.css',
            'xmodule/modules.css',
        ],
        'output_filename': 'css/lms-style-course-rtl.css',
    },
1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192
    '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',
    },
1193
}
1194

1195

1196 1197 1198 1199
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)
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)


1200 1201
PIPELINE_JS = {
    'application': {
1202

1203
        # Application will contain all paths not in courseware_only_js
1204
        'source_filenames': ['js/xblock/core.js'] + sorted(common_js) + sorted(project_js) + [
1205 1206 1207 1208
            'js/form.ext.js',
            'js/my_courses_dropdown.js',
            'js/toggle_login_modal.js',
            'js/sticky_filter.js',
1209
            'js/query-params.js',
1210
            'js/src/utility.js',
1211
            'js/src/accessibility_tools.js',
1212
            'js/src/ie_shim.js',
1213
            'js/src/string_utils.js',
1214
        ],
1215
        'output_filename': 'js/lms-application.js',
1216
    },
1217
    'courseware': {
1218
        'source_filenames': courseware_js,
1219
        'output_filename': 'js/lms-courseware.js',
1220 1221 1222 1223
    },
    'base_vendor': {
        'source_filenames': base_vendor_js,
        'output_filename': 'js/lms-base-vendor.js',
1224
    },
1225 1226
    'main_vendor': {
        'source_filenames': main_vendor_js,
1227
        'output_filename': 'js/lms-main_vendor.js',
1228
    },
1229 1230 1231 1232
    'module-descriptor-js': {
        'source_filenames': rooted_glob(COMMON_ROOT / 'static/', 'xmodule/descriptors/js/*.js'),
        'output_filename': 'js/lms-module-descriptors.js',
    },
1233
    'module-js': {
1234
        'source_filenames': rooted_glob(COMMON_ROOT / 'static', 'xmodule/modules/js/*.js'),
1235
        'output_filename': 'js/lms-modules.js',
1236
    },
1237 1238
    'discussion': {
        'source_filenames': discussion_js,
1239
        'output_filename': 'js/discussion.js',
1240
    },
Calen Pennington committed
1241
    'staff_grading': {
1242
        'source_filenames': staff_grading_js,
1243
        'output_filename': 'js/staff_grading.js',
1244
    },
Calen Pennington committed
1245
    'open_ended': {
1246
        'source_filenames': open_ended_js,
1247
        'output_filename': 'js/open_ended.js',
Arthur Barrett committed
1248 1249 1250
    },
    'notes': {
        'source_filenames': notes_js,
1251
        'output_filename': 'js/notes.js',
Arthur Barrett committed
1252
    },
1253 1254 1255
    'instructor_dash': {
        'source_filenames': instructor_dash_js,
        'output_filename': 'js/instructor_dash.js',
1256
    },
Will Daly committed
1257 1258 1259 1260
    'dashboard': {
        'source_filenames': dashboard_js,
        'output_filename': 'js/dashboard.js'
    },
1261 1262 1263 1264
    'rwd_header_footer': {
        'source_filenames': rwd_header_footer_js,
        'output_filename': 'js/rwd_header_footer.js'
    },
1265 1266 1267 1268 1269 1270 1271
    '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'
1272
    },
1273 1274 1275 1276
    'verify_student': {
        'source_filenames': verify_student_js,
        'output_filename': 'js/verify_student.js'
    }
1277 1278
}

1279 1280
PIPELINE_DISABLE_WRAPPER = True

1281 1282 1283
# 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.
1284 1285 1286 1287 1288 1289 1290 1291 1292 1293
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
1294
                    js_timestamp = os.stat(js_dir / new_filename).st_mtime
1295 1296
                    if coffee_timestamp <= js_timestamp:
                        continue
1297
                os.system("rm %s" % (js_dir / new_filename))
1298 1299
                os.system("coffee -c %s" % (js_dir / filename))

1300 1301

PIPELINE_CSS_COMPRESSOR = None
1302
PIPELINE_JS_COMPRESSOR = "pipeline.compressors.uglifyjs.UglifyJSCompressor"
1303

1304
STATICFILES_IGNORE_PATTERNS = (
1305 1306
    "sass/*",
    "coffee/*",
1307 1308 1309 1310

    # Symlinks used by js-test-tool
    "xmodule_js",
    "common_static",
1311 1312
)

1313
PIPELINE_UGLIFYJS_BINARY = 'node_modules/.bin/uglifyjs'
1314

1315
# Setting that will only affect the edX version of django-pipeline until our changes are merged upstream
1316 1317
PIPELINE_COMPILE_INPLACE = True

1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348
################################# 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'
1349
HIGH_MEM_QUEUE = 'edx.core.high_mem'
1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360

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: {},
1361 1362
    DEFAULT_PRIORITY_QUEUE: {},
    HIGH_MEM_QUEUE: {},
1363 1364
}

1365 1366 1367 1368 1369
# let logging work as configured:
CELERYD_HIJACK_ROOT_LOGGER = False

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

1370 1371
# Suffix used to construct 'from' email address for bulk emails.
# A course-specific identifier is prepended.
1372
BULK_EMAIL_DEFAULT_FROM_EMAIL = 'no-reply@example.com'
1373 1374 1375

# Parameters for breaking down course enrollment into subtasks.
BULK_EMAIL_EMAILS_PER_TASK = 100
1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388

# 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

1389 1390 1391
# 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
1392 1393 1394 1395

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

1397 1398 1399 1400 1401 1402
# 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

1403 1404 1405 1406
############################# Email Opt In ####################################

# Minimum age for organization-wide email opt in
EMAIL_OPTIN_MINIMUM_AGE = 13
1407

1408 1409
############################## Video ##########################################

1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426
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',
        },
    },
}
1427

1428
################################### APPS ######################################
1429 1430 1431 1432 1433 1434 1435 1436
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',
1437
    'djcelery',
1438 1439
    'south',

1440 1441 1442
    # Database-backed configuration
    'config_models',

1443 1444 1445
    # Monitor the status of services
    'service_status',

1446
    # For asset pipelining
David Baumgold committed
1447
    'edxmako',
1448 1449
    'pipeline',
    'staticfiles',
1450
    'static_replace',
1451

1452 1453 1454 1455
    # Our courseware
    'circuit',
    'courseware',
    'student',
1456

1457 1458 1459
    'static_template_view',
    'staticbook',
    'track',
1460
    'eventtracking.django',
1461
    'util',
1462
    'certificates',
Carson Gee committed
1463
    'dashboard',
1464
    'instructor',
1465
    'instructor_task',
1466
    'open_ended_grading',
1467
    'psychometrics',
1468
    'licenses',
1469
    'openedx.core.djangoapps.course_groups',
1470
    'bulk_email',
1471

1472 1473 1474 1475
    # External auth (OpenID, shib)
    'external_auth',
    'django_openid_auth',

1476 1477 1478 1479 1480
    # OAuth2 Provider
    'provider',
    'provider.oauth2',
    'oauth2_provider',

1481
    # For the wiki
1482
    'wiki',  # The new django-wiki from benjaoming
1483
    'django_notify',
1484
    'course_wiki',  # Our customizations
1485 1486
    'mptt',
    'sekizai',
1487
    #'wiki.plugins.attachments',
1488
    'wiki.plugins.links',
1489
    'wiki.plugins.notifications',
1490
    'course_wiki.plugins.markdownedx',
1491

1492
    # Foldit integration
Victor Shnayder committed
1493 1494
    'foldit',

1495
    # For testing
1496
    'django.contrib.admin',  # only used in DEBUG mode
1497
    'django_nose',
1498
    'debug',
1499

1500
    # Discussion forums
1501
    'django_comment_client',
1502
    'django_comment_common',
1503
    'notes',
1504

1505 1506 1507
    # Splash screen
    'splash',

1508 1509 1510
    # Monitoring
    'datadog',

1511 1512
    # User API
    'rest_framework',
1513
    'openedx.core.djangoapps.user_api',
1514

1515
    # Shopping cart
1516 1517
    'shoppingcart',

1518 1519
    # Notification preferences setting
    'notification_prefs',
1520

1521 1522
    'notifier_api',

1523
    # Different Course Modes
1524
    'course_modes',
1525 1526 1527

    # Student Identity Verification
    'verify_student',
1528 1529 1530

    # Dark-launching languages
    'dark_lang',
1531 1532

    # Microsite configuration
1533
    'microsite_configuration',
1534 1535 1536

    # Student Identity Reverification
    'reverification',
1537 1538

    'embargo',
1539 1540 1541

    # Monitoring functionality
    'monitoring',
1542 1543

    # Course action state
Chris Rossi committed
1544 1545 1546 1547
    'course_action_state',

    # Additional problem types
    'edx_jsme',    # Molecular Structure
1548 1549

    # Country list
1550 1551 1552 1553
    'django_countries',

    # edX Mobile API
    'mobile_api',
1554 1555 1556

    # Surveys
    'survey',
1557 1558

    'lms.djangoapps.lms_xblock',
1559
)
1560

1561 1562
######################### MARKETING SITE ###############################
EDXMKTG_COOKIE_NAME = 'edxloggedin'
1563
MKTG_URLS = {}
1564 1565 1566 1567 1568 1569
MKTG_URL_LINK_MAP = {
    'ABOUT': 'about_edx',
    'CONTACT': 'contact',
    'FAQ': 'help_edx',
    'COURSES': 'courses',
    'ROOT': 'root',
1570 1571 1572
    'TOS': 'tos',
    'HONOR': 'honor',
    'PRIVACY': 'privacy_edx',
1573
    'JOBS': 'jobs',
1574
    'NEWS': 'news',
1575
    'PRESS': 'press',
1576 1577
    'BLOG': 'edx-blog',
    'DONATE': 'donate',
1578 1579

    # Verified Certificates
1580
    'WHAT_IS_VERIFIED_CERT': 'verified-certificate',
1581
}
1582

1583

1584 1585
################# Student Verification #################
VERIFY_STUDENT = {
1586
    "DAYS_GOOD_FOR": 365,  # How many days is a verficiation good for?
1587
}
1588

1589 1590 1591 1592 1593
### This enables the Metrics tab for the Instructor dashboard ###########
FEATURES['CLASS_DASHBOARD'] = False
if FEATURES.get('CLASS_DASHBOARD'):
    INSTALLED_APPS += ('class_dashboard',)

1594 1595
######################## CAS authentication ###########################

1596
if FEATURES.get('AUTH_USE_CAS'):
1597 1598 1599 1600
    CAS_SERVER_URL = 'https://provide_your_cas_url_here'
    AUTHENTICATION_BACKENDS = (
        'django.contrib.auth.backends.ModelBackend',
        'django_cas.backends.CASBackend',
1601
    )
1602 1603
    INSTALLED_APPS += ('django_cas',)
    MIDDLEWARE_CLASSES += ('django_cas.middleware.CASMiddleware',)
1604 1605 1606

###################### Registration ##################################

1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618
# 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',
1619
    'terms_of_service': 'hidden',
1620 1621 1622
    'city': 'hidden',
    'country': 'hidden',
}
1623

1624 1625 1626 1627
########################## CERTIFICATE NAME ########################
CERT_NAME_SHORT = "Certificate"
CERT_NAME_LONG = "Certificate of Achievement"

1628
###################### Grade Downloads ######################
1629 1630 1631
GRADES_DOWNLOAD_ROUTING_KEY = HIGH_MEM_QUEUE

GRADES_DOWNLOAD = {
1632 1633 1634
    'STORAGE_TYPE': 'localfs',
    'BUCKET': 'edx-grades',
    'ROOT_PATH': '/tmp/edx-s3/grades',
1635
}
1636

1637
######################## PROGRESS SUCCESS BUTTON ##############################
1638 1639 1640
# The following fields are available in the URL: {course_id} {student_id}
PROGRESS_SUCCESS_BUTTON_URL = 'http://<domain>/<path>/{course_id}'
PROGRESS_SUCCESS_BUTTON_TEXT_OVERRIDE = None
1641

1642 1643 1644 1645 1646 1647 1648 1649
#### PASSWORD POLICY SETTINGS #####

PASSWORD_MIN_LENGTH = None
PASSWORD_MAX_LENGTH = None
PASSWORD_COMPLEXITY = {}
PASSWORD_DICTIONARY_EDIT_DISTANCE_THRESHOLD = None
PASSWORD_DICTIONARY = []

1650 1651 1652 1653 1654 1655 1656 1657 1658 1659
##################### LinkedIn #####################
INSTALLED_APPS += ('django_openid_auth',)


############################ LinkedIn Integration #############################
INSTALLED_APPS += ('linkedin',)
LINKEDIN_API = {
    'EMAIL_WHITELIST': [],
    'COMPANY_ID': '2746406',
}
1660

1661

1662 1663 1664 1665 1666
############################ ORA 2 ############################################

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

Stephen Sanchez committed
1667 1668 1669
# Default File Upload Storage bucket and prefix. Used by the FileUpload Service.
FILE_UPLOAD_STORAGE_BUCKET_NAME = 'edxuploads'
FILE_UPLOAD_STORAGE_PREFIX = 'submissions_attachments'
1670

1671 1672 1673
##### ACCOUNT LOCKOUT DEFAULT PARAMETERS #####
MAX_FAILED_LOGIN_ATTEMPTS_ALLOWED = 5
MAX_FAILED_LOGIN_ATTEMPTS_LOCKOUT_PERIOD_SECS = 15 * 60
1674 1675 1676 1677


##### LMS DEADLINE DISPLAY TIME_ZONE #######
TIME_ZONE_DISPLAYED_FOR_DEADLINES = 'UTC'
1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707


# Source:
# http://loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt according to http://en.wikipedia.org/wiki/ISO_639-1
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"],
1708
    [u"ca", u"Catalan"],
1709 1710 1711
    [u"ch", u"Chamorro"],
    [u"ce", u"Chechen"],
    [u"zh", u"Chinese"],
1712
    [u"cu", u"Church Slavic"],
1713 1714 1715 1716 1717 1718
    [u"cv", u"Chuvash"],
    [u"kw", u"Cornish"],
    [u"co", u"Corsican"],
    [u"cr", u"Cree"],
    [u"cs", u"Czech"],
    [u"da", u"Danish"],
1719 1720
    [u"dv", u"Divehi"],
    [u"nl", u"Dutch"],
1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733
    [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"],
1734
    [u"gd", u"Gaelic"],
1735 1736 1737
    [u"ga", u"Irish"],
    [u"gl", u"Galician"],
    [u"gv", u"Manx"],
1738
    [u"el", u"Greek"],
1739 1740
    [u"gn", u"Guarani"],
    [u"gu", u"Gujarati"],
1741
    [u"ht", u"Haitian"],
1742 1743 1744 1745 1746 1747 1748 1749 1750 1751
    [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"],
1752
    [u"ii", u"Sichuan Yi"],
1753
    [u"iu", u"Inuktitut"],
1754 1755
    [u"ie", u"Interlingue"],
    [u"ia", u"Interlingua"],
1756 1757 1758 1759 1760
    [u"id", u"Indonesian"],
    [u"ik", u"Inupiaq"],
    [u"it", u"Italian"],
    [u"jv", u"Javanese"],
    [u"ja", u"Japanese"],
1761
    [u"kl", u"Kalaallisut"],
1762 1763 1764 1765 1766
    [u"kn", u"Kannada"],
    [u"ks", u"Kashmiri"],
    [u"kr", u"Kanuri"],
    [u"kk", u"Kazakh"],
    [u"km", u"Central Khmer"],
1767
    [u"ki", u"Kikuyu"],
1768
    [u"rw", u"Kinyarwanda"],
1769
    [u"ky", u"Kirghiz"],
1770 1771 1772
    [u"kv", u"Komi"],
    [u"kg", u"Kongo"],
    [u"ko", u"Korean"],
1773
    [u"kj", u"Kuanyama"],
1774 1775 1776 1777
    [u"ku", u"Kurdish"],
    [u"lo", u"Lao"],
    [u"la", u"Latin"],
    [u"lv", u"Latvian"],
1778
    [u"li", u"Limburgan"],
1779 1780
    [u"ln", u"Lingala"],
    [u"lt", u"Lithuanian"],
1781
    [u"lb", u"Luxembourgish"],
1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793
    [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"],
1794 1795 1796
    [u"nv", u"Navajo"],
    [u"nr", u"Ndebele, South"],
    [u"nd", u"Ndebele, North"],
1797 1798
    [u"ng", u"Ndonga"],
    [u"ne", u"Nepali"],
1799 1800
    [u"nn", u"Norwegian Nynorsk"],
    [u"nb", u"Bokmål, Norwegian"],
1801
    [u"no", u"Norwegian"],
1802 1803
    [u"ny", u"Chichewa"],
    [u"oc", u"Occitan"],
1804 1805 1806
    [u"oj", u"Ojibwa"],
    [u"or", u"Oriya"],
    [u"om", u"Oromo"],
1807 1808
    [u"os", u"Ossetian"],
    [u"pa", u"Panjabi"],
1809 1810 1811 1812
    [u"fa", u"Persian"],
    [u"pi", u"Pali"],
    [u"pl", u"Polish"],
    [u"pt", u"Portuguese"],
1813
    [u"ps", u"Pushto"],
1814 1815
    [u"qu", u"Quechua"],
    [u"rm", u"Romansh"],
1816
    [u"ro", u"Romanian"],
1817 1818 1819 1820
    [u"rn", u"Rundi"],
    [u"ru", u"Russian"],
    [u"sg", u"Sango"],
    [u"sa", u"Sanskrit"],
1821
    [u"si", u"Sinhala"],
1822 1823 1824 1825 1826 1827 1828 1829
    [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"],
1830
    [u"es", u"Spanish"],
1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851
    [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"],
1852
    [u"ug", u"Uighur"],
1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864
    [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"],
1865
    [u"za", u"Zhuang"],
1866 1867
    [u"zu", u"Zulu"]
)
1868 1869


1870 1871 1872
### Apps only installed in some instances
OPTIONAL_APPS = (
    'mentoring',
Will Daly committed
1873 1874 1875 1876 1877

    # edx-ora2
    'submissions',
    'openassessment',
    'openassessment.assessment',
1878
    'openassessment.fileupload',
Will Daly committed
1879
    'openassessment.workflow',
1880 1881 1882 1883
    'openassessment.xblock',

    # edxval
    'edxval'
1884
)
1885

1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897
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,)
1898 1899 1900 1901

# Stub for third_party_auth options.
# See common/djangoapps/third_party_auth/settings.py for configuration details.
THIRD_PARTY_AUTH = {}
1902 1903 1904 1905

### ADVANCED_SECURITY_CONFIG
# Empty by default
ADVANCED_SECURITY_CONFIG = {}
1906 1907 1908 1909

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

1911
### Analytics Data API + Dashboard (Insights) settings
1912 1913
ANALYTICS_DATA_URL = ""
ANALYTICS_DATA_TOKEN = ""
1914
ANALYTICS_DASHBOARD_URL = ""
1915
ANALYTICS_DASHBOARD_NAME = PLATFORM_NAME + " Insights"
1916

1917 1918 1919
# 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"
1920 1921 1922 1923 1924 1925

# Country code overrides
# Used by django-countries
COUNTRIES_OVERRIDE = {
    "TW": _("Taiwan"),
}
1926 1927 1928 1929 1930 1931 1932 1933

# 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'