Newer
Older
"""
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
FEATURES[...]. Modules that extend this one can change the feature
configuration in an environment specific config file and re-calculate those
values.
We should make a method that calls all these config methods so that you just
make one call at the end of your site-specific dev file to reset all the
dependent variables (like INSTALLED_APPS) for you.
Longer TODO:
1. Right now our treatment of static content in general and in particular
course-specific static content is haphazard.
2. We should have a more disciplined approach to feature flagging, even if it
just means that we stick them in a dict called FEATURES.
3. We need to handle configuration for multiple courses. This could be as
multiple sites, but we do need a way to map their data assets.
Piotr Mitros
committed
When refering to XBlocks, we use the entry-point name. For example,
| setup(
| name='xblock-foobar',
| version='0.1',
| packages=[
| 'foobar_xblock',
| ],
| entry_points={
| 'xblock.v1': [
| 'foobar-block = foobar_xblock:FoobarBlock',
| # ^^^^^^^^^^^^ This is the one you want.
| ]
| },
| )
Calen Pennington
committed
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
import imp
Tim Babych
committed
import os
from datetime import timedelta
Calen Pennington
committed
import lms.envs.common
# Although this module itself may not use these imported variables, other dependent modules may.
from lms.envs.common import (
USE_TZ, ALL_LANGUAGES, update_module_store_settings, ASSET_IGNORE_REGEX,
PARENTAL_CONSENT_AGE_LIMIT, REGISTRATION_EMAIL_PATTERNS_ALLOWED,
# The following PROFILE_IMAGE_* settings are included as they are
# indirectly accessed through the email opt-in API, which is
# technically accessible through the CMS via legacy URLs.
PROFILE_IMAGE_BACKEND, PROFILE_IMAGE_DEFAULT_FILENAME, PROFILE_IMAGE_DEFAULT_FILE_EXTENSION,
PROFILE_IMAGE_SECRET_KEY, PROFILE_IMAGE_MIN_BYTES, PROFILE_IMAGE_MAX_BYTES, PROFILE_IMAGE_SIZES_MAP,
# The following setting is included as it is used to check whether to
# display credit eligibility table on the CMS or not.
COURSE_MODE_DEFAULTS, DEFAULT_COURSE_ABOUT_IMAGE_URL,
# User-uploaded content
MEDIA_ROOT,
MEDIA_URL,
# Django REST framework configuration
REST_FRAMEWORK,
STATICI18N_OUTPUT_DIR,
# Heartbeat
HEARTBEAT_CHECKS,
HEARTBEAT_EXTENDED_CHECKS,
HEARTBEAT_CELERY_TIMEOUT,
# Default site to use if no site exists matching request headers
SITE_ID,
# constants for redirects app
REDIRECT_CACHE_TIMEOUT,
REDIRECT_CACHE_KEY_PREFIX,
# This is required for the migrations in oauth_dispatch.models
# otherwise it fails saying this attribute is not present in Settings
# Although Studio does not enable OAuth2 Provider capability, the new approach
# to generating test databases will discover and try to create all tables
# and this setting needs to be present
OAUTH2_PROVIDER_APPLICATION_MODEL,
USERNAME_REGEX_PARTIAL,
USERNAME_PATTERN,
# django-debug-toolbar
DEBUG_TOOLBAR_PATCH_SETTINGS,
COURSE_ENROLLMENT_MODES,
CONTENT_TYPE_GATE_GROUP_IDS,
DISABLE_ACCOUNT_ACTIVATION_REQUIREMENT_SWITCH,
GENERATE_PROFILE_SCORES,
# Enterprise service settings
ENTERPRISE_CATALOG_INTERNAL_ROOT_URL,
_make_mako_template_dirs,
from path import Path as path
from django.core.urlresolvers import reverse_lazy
Calen Pennington
committed
from lms.djangoapps.lms_xblock.mixin import LmsBlockMixin
from cms.lib.xblock.authoring_mixin import AuthoringMixin
from xmodule.modulestore.edit_info import EditInfoMixin
from openedx.core.djangoapps.theming.helpers_dirs import (
get_themes_unchecked,
get_theme_base_dirs_from_settings
)
from openedx.core.lib.license import LicenseMixin
from openedx.core.lib.derived import derived, derived_collection_entry
from openedx.core.release import doc_version
################ Enable credit eligibility feature ####################
ENABLE_CREDIT_ELIGIBILITY = True
################################ Block Structures ###################################
BLOCK_STRUCTURES_SETTINGS = dict(
# Delay, in seconds, after a new edit of a course is published
# before updating the block structures cache. This is needed
# for a better chance at getting the latest changes when there
# are secondary reads in sharded mongoDB clusters. See TNL-5041
# for more info.
COURSE_PUBLISH_TASK_DELAY=30,
# Delay, in seconds, between retry attempts if a task fails.
TASK_DEFAULT_RETRY_DELAY=30,
# Maximum number of retries per task.
TASK_MAX_RETRIES=5,
# Backend storage options
PRUNING_ACTIVE=False,
)
############################ FEATURE CONFIGURATION #############################
PLATFORM_NAME = _('Your Platform Name Here')
PLATFORM_DESCRIPTION = _('Your Platform Description Here')
PLATFORM_FACEBOOK_ACCOUNT = "http://www.facebook.com/YourPlatformFacebookAccount"
PLATFORM_TWITTER_ACCOUNT = "@YourPlatformTwitterAccount"
STUDIO_NAME = _("Your Platform Studio")
STUDIO_SHORT_NAME = _("Studio")
'GITHUB_PUSH': False,
# for consistency in user-experience, keep the value of the following 3 settings
# in sync with the ones in lms/envs/common.py
'ENABLE_DISCUSSION_SERVICE': True,
# DO NOT SET TO True IN THIS FILE
# Doing so will cause all courses to be released on production
'DISABLE_START_DATES': False, # When True, all courses will be active, regardless of start date
# email address for studio staff (eg to request course creation)
'STUDIO_REQUEST_EMAIL': '',
# Segment - must explicitly turn it on for production
'CMS_SEGMENT_KEY': None,
# Enable URL that shows information about the status of various services
Peter Fogg
committed
'ENABLE_SERVICE_STATUS': False,
# Don't autoplay videos for course authors
# Move the course author to next page when a video finishes. Set to True to
# show an auto-advance button in videos. If False, videos never auto-advance.
'ENABLE_AUTOADVANCE_VIDEOS': False,
# If set to True, new Studio users won't be able to author courses unless
# an Open edX admin has added them to the course creator group.
'ENABLE_CREATOR_GROUP': True,
# Turn off account locking if failed login attempts exceeds a limit
'ENABLE_MAX_FAILED_LOGIN_ATTEMPTS': False,
# Allow editing of short description in course settings in cms
'EDITABLE_SHORT_DESCRIPTION': True,
Chris Dodge
committed
# Hide any Personally Identifiable Information from application logs
'SQUELCH_PII_IN_LOGS': False,
# Toggles the embargo functionality, which blocks users
# based on their location.
# Allow creating courses with non-ascii characters in the course id
'ALLOW_UNICODE_COURSE_ID': False,
# Prevent concurrent logins per user
'PREVENT_CONCURRENT_LOGINS': False,
# Turn off Video Upload Pipeline through Studio, by default
'ENABLE_VIDEO_UPLOAD_PIPELINE': False,
# let students save and manage their annotations
# for consistency in user-experience, keep the value of this feature flag
# in sync with the one in lms/envs/common.py
'ENABLE_EDXNOTES': False,
# Toggle to enable coordination with the Publisher tool (keep in sync with lms/envs/common.py)
'ENABLE_PUBLISHER': False,
# Show a new field in "Advanced settings" that can store custom data about a
# course and that can be read from themes
'ENABLE_OTHER_COURSE_SETTINGS': False,
# Write new CSM history to the extended table.
# This will eventually default to True and may be
# removed since all installs should have the separate
# extended history table. This is needed in the LMS and CMS
# for migration consistency.
'ENABLE_CSMH_EXTENDED': True,
# Enable support for content libraries. Note that content libraries are
'ENABLE_CONTENT_LIBRARIES': True,
# Milestones application flag
'MILESTONES_APP': False,
# Prerequisite courses feature flag
'ENABLE_PREREQUISITE_COURSES': False,
# Toggle course entrance exams feature
'ENTRANCE_EXAMS': False,
# Toggle platform-wide course licensing
'LICENSING': False,
# Enable the courseware search functionality
'ENABLE_COURSEWARE_INDEX': False,
E. Kolpakov
committed
# Enable content libraries search functionality
'ENABLE_LIBRARY_INDEX': False,
# Enable course reruns, which will always use the split modulestore
'ALLOW_COURSE_RERUNS': True,
Matt Drayer
committed
# Certificates Web/HTML Views
'CERTIFICATES_HTML_VIEW': False,
# Show video bumper in Studio
'ENABLE_VIDEO_BUMPER': False,
# Show issue open badges in Studio
'ENABLE_OPENBADGES': False,
# How many seconds to show the bumper again, default is 7 days:
'SHOW_BUMPER_PERIODICITY': 7 * 24 * 3600,
# Enable credit eligibility feature
'ENABLE_CREDIT_ELIGIBILITY': ENABLE_CREDIT_ELIGIBILITY,
# Special Exams, aka Timed and Proctored Exams
'ENABLE_SPECIAL_EXAMS': False,
# Show the language selector in the header
'SHOW_HEADER_LANGUAGE_SELECTOR': False,
# At edX it's safe to assume that English transcripts are always available
# This is not the case for all installations.
# The default value in {lms,cms}/envs/common.py and xmodule/tests/test_video.py should be consistent.
'FALLBACK_TO_ENGLISH_TRANSCRIPTS': True,
# Set this to False to facilitate cleaning up invalid xml from your modulestore.
'ENABLE_XBLOCK_XML_VALIDATION': True,
# Allow public account creation
'ALLOW_PUBLIC_ACCOUNT_CREATION': True,
# Whether or not the dynamic EnrollmentTrackUserPartition should be registered.
'ENABLE_ENROLLMENT_TRACK_USER_PARTITION': True,
# Whether to send an email for failed password reset attempts or not. This is mainly useful for notifying users
# that they don't have an account associated with email addresses they believe they've registered with.
'ENABLE_PASSWORD_RESET_FAILURE_EMAIL': False,
# Whether archived courses (courses with end dates in the past) should be
'ENABLE_SEPARATE_ARCHIVED_COURSES': True,
# For acceptance and load testing
'AUTOMATIC_AUTH_FOR_TESTING': False,
# Prevent auto auth from creating superusers or modifying existing users
'RESTRICT_AUTOMATIC_AUTH': True,
'AUTH_USE_OPENID_PROVIDER': True,
'ENABLE_INSTRUCTOR_ANALYTICS': False,
'PREVIEW_LMS_BASE': "preview.localhost:18000",
'ENABLE_GRADE_DOWNLOADS': True,
'ENABLE_MKTG_SITE': False,
'ENABLE_DISCUSSION_HOME_PANEL': True,
'ENABLE_CORS_HEADERS': False,
'ENABLE_CROSS_DOMAIN_CSRF_COOKIE': False,
'ENABLE_COUNTRY_ACCESS': False,
'ENABLE_CREDIT_API': False,
'ENABLE_OAUTH2_PROVIDER': False,
'ENABLE_SYSADMIN_DASHBOARD': False,
'ENABLE_MOBILE_REST_API': False,
'CUSTOM_COURSES_EDX': False,
'ENABLE_READING_FROM_MULTIPLE_HISTORY_TABLES': True,
'SHOW_FOOTER_LANGUAGE_SELECTOR': False,
'ENABLE_ENROLLMENT_RESET': False,
Calen Pennington
committed
ENABLE_JASMINE = False
# List of logout URIs for each IDA that the learner should be logged out of when they logout of the LMS. Only applies to
# IDA for which the social auth flow uses DOT (Django OAuth Toolkit).
IDA_LOGOUT_URI_LIST = []
############################# SOCIAL MEDIA SHARING #############################
SOCIAL_SHARING_SETTINGS = {
# Note: Ensure 'CUSTOM_COURSE_URLS' has a matching value in lms/envs/common.py
'CUSTOM_COURSE_URLS': False,
'DASHBOARD_FACEBOOK': False,
'CERTIFICATE_FACEBOOK': False,
'CERTIFICATE_TWITTER': False,
'DASHBOARD_TWITTER': False
SOCIAL_MEDIA_FOOTER_URLS = {}
# This is just a placeholder image.
# Site operators can customize this with their organization's image.
FOOTER_ORGANIZATION_IMAGE = "images/logo.png"
############################# SET PATH INFORMATION #############################
PROJECT_ROOT = path(__file__).abspath().dirname().dirname() # /edx-platform/cms
Calen Pennington
committed
REPO_ROOT = PROJECT_ROOT.dirname()
COMMON_ROOT = REPO_ROOT / "common"
OPENEDX_ROOT = REPO_ROOT / "openedx"
ENV_ROOT = REPO_ROOT.dirname() # virtualenv dir /edx-platform is in
Calen Pennington
committed
GITHUB_REPO_ROOT = ENV_ROOT / "data"
Calen Pennington
committed
sys.path.append(REPO_ROOT)
sys.path.append(PROJECT_ROOT / 'djangoapps')
sys.path.append(COMMON_ROOT / 'djangoapps')
GEOIP_PATH = REPO_ROOT / "common/static/data/geoip/GeoLite2-Country.mmdb"
DJFS = {
'type': 'osfs',
'directory_root': '/edx/var/edxapp/django-pyfs/static/django-pyfs',
'url_root': '/static/django-pyfs',
}
######################## BRANCH.IO ###########################
BRANCH_IO_KEY = ''
######################## GOOGLE ANALYTICS ###########################
GOOGLE_ANALYTICS_ACCOUNT = None
############################# TEMPLATE CONFIGURATION #############################
# Mako templating
MAKO_MODULE_DIR = os.path.join(tempfile.gettempdir(), 'mako_cms')
MAKO_TEMPLATE_DIRS_BASE = [
PROJECT_ROOT / 'templates',
Calen Pennington
committed
COMMON_ROOT / 'templates',
COMMON_ROOT / 'djangoapps' / 'pipeline_mako' / 'templates',
COMMON_ROOT / 'static', # required to statically include common Underscore templates
OPENEDX_ROOT / 'core' / 'djangoapps' / 'cors_csrf' / 'templates',
OPENEDX_ROOT / 'core' / 'djangoapps' / 'dark_lang' / 'templates',
OPENEDX_ROOT / 'core' / 'lib' / 'license' / 'templates',
CMS_ROOT / 'djangoapps' / 'pipeline_js' / 'templates',
CONTEXT_PROCESSORS = (
'django.template.context_processors.request',
'django.template.context_processors.static',
'django.contrib.messages.context_processors.messages',
'django.template.context_processors.i18n',
'django.contrib.auth.context_processors.auth', # this is required for admin
'django.template.context_processors.csrf',
'help_tokens.context_processor',
'openedx.core.djangoapps.site_configuration.context_processors.configuration_context',
Calen Pennington
committed
# Django templating
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
# Don't look for template source files inside installed applications.
'APP_DIRS': False,
# Instead, look for template source files in these dirs.
'DIRS': _make_mako_template_dirs,
# Options specific to this backend.
'OPTIONS': {
'loaders': (
# We have to use mako-aware template loaders to be able to include
# mako templates inside django templates (such as main_django.html).
'openedx.core.djangoapps.theming.template_loaders.ThemeTemplateLoader',
'edxmako.makoloader.MakoFilesystemLoader',
'edxmako.makoloader.MakoAppDirectoriesLoader',
'context_processors': CONTEXT_PROCESSORS,
# Change 'debug' in your environment settings files - not here.
'debug': False
}
},
{
'NAME': 'mako',
'BACKEND': 'edxmako.backend.Mako',
'APP_DIRS': False,
'DIRS': _make_mako_template_dirs,
'OPTIONS': {
'context_processors': CONTEXT_PROCESSORS,
'debug': False,
}
},
{
# This separate copy of the Mako backend is used to render previews using the LMS templates
'NAME': 'preview',
'BACKEND': 'edxmako.backend.Mako',
'APP_DIRS': False,
'DIRS': lms.envs.common.MAKO_TEMPLATE_DIRS_BASE,
'OPTIONS': {
'context_processors': CONTEXT_PROCESSORS,
'debug': False,
'namespace': 'lms.main',
}
},
derived_collection_entry('TEMPLATES', 0, 'DIRS')
derived_collection_entry('TEMPLATES', 1, 'DIRS')
DEFAULT_TEMPLATE_ENGINE = TEMPLATES[0]
#################################### AWS #######################################
# S3BotoStorage insists on a timeout for uploaded assets. We should make it
# permanent instead, but rather than trying to figure out exactly where that
# setting is, I'm just bumping the expiration time to something absurd (100
# years). This is only used if DEFAULT_FILE_STORAGE is overriden to use S3
# in the global settings.py
AWS_SES_REGION_NAME = 'us-east-1'
AWS_SES_REGION_ENDPOINT = 'email.us-east-1.amazonaws.com'
AWS_ACCESS_KEY_ID = None
AWS_SECRET_ACCESS_KEY = None
AWS_QUERYSTRING_AUTH = False
AWS_STORAGE_BUCKET_NAME = 'SET-ME-PLEASE (ex. bucket-name)'
AWS_S3_CUSTOM_DOMAIN = 'SET-ME-PLEASE (ex. bucket-name.s3.amazonaws.com)'
##############################################################################
# use the ratelimit backend to prevent brute force attacks
AUTHENTICATION_BACKENDS = [
'rules.permissions.ObjectPermissionBackend',
'openedx.core.djangoapps.oauth_dispatch.dot_overrides.backends.EdxRateLimitedAllowAllUsersModelBackend',
'bridgekeeper.backends.RulePermissionBackend',
STATIC_ROOT_BASE = '/edx/var/edxapp/staticfiles'
# License for serving content in China
ICP_LICENSE = None
ICP_LICENSE_INFO = {}
LOGGING_ENV = 'sandbox'
LMS_BASE = 'localhost:18000'
LMS_ROOT_URL = "https://localhost:18000"
LOGIN_REDIRECT_URL = EDX_ROOT_URL + '/home/'
# TODO: Determine if LOGIN_URL could be set to the FRONTEND_LOGIN_URL value instead.
LOGIN_URL = reverse_lazy('login_redirect_to_lms')
FRONTEND_LOGIN_URL = lambda settings: settings.LMS_ROOT_URL + '/login'
derived('FRONTEND_LOGIN_URL')
FRONTEND_LOGOUT_URL = lambda settings: settings.LMS_ROOT_URL + '/logout'
derived('FRONTEND_LOGOUT_URL')
FRONTEND_REGISTER_URL = lambda settings: settings.LMS_ROOT_URL + '/register'
derived('FRONTEND_REGISTER_URL')
LMS_ENROLLMENT_API_PATH = "/api/enrollment/v1/"
ENTERPRISE_API_URL = LMS_INTERNAL_ROOT_URL + '/enterprise/api/v1/'
ENTERPRISE_CONSENT_API_URL = LMS_INTERNAL_ROOT_URL + '/consent/api/v1/'
# Public domain name of Studio (should be resolvable from the end-user's browser)
CMS_BASE = 'localhost:18010'
LOG_DIR = '/edx/var/log/edx'
LOCAL_LOGLEVEL = "INFO"
MAINTENANCE_BANNER_TEXT = 'Sample banner message'
WIKI_ENABLED = True
CERT_QUEUE = 'certificates'
# List of logout URIs for each IDA that the learner should be logged out of when they logout of
# Studio. Only applies to IDA for which the social auth flow uses DOT (Django OAuth Toolkit).
IDA_LOGOUT_URI_LIST = []
ELASTIC_SEARCH_CONFIG = [
{
'use_ssl': False,
'host': 'localhost',
'port': 9200
}
]
# 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.
from lms.envs.common import (
COURSE_KEY_PATTERN, COURSE_KEY_REGEX, COURSE_ID_PATTERN, USAGE_KEY_PATTERN, ASSET_KEY_PATTERN
######################### CSRF #########################################
# Forwards-compatibility with Django 1.7
CSRF_COOKIE_AGE = 60 * 60 * 24 * 7 * 52
# It is highly recommended that you override this in any environment accessed by
# end users
CSRF_COOKIE_SECURE = False
CROSS_DOMAIN_CSRF_COOKIE_DOMAIN = ''
CROSS_DOMAIN_CSRF_COOKIE_NAME = ''
Calen Pennington
committed
#################### CAPA External Code Evaluation #############################
XQUEUE_INTERFACE = {
'url': 'http://localhost:18040',
'basic_auth': ['edx', 'edx'],
'django_auth': {
'username': 'lms',
'password': 'password'
}
Calen Pennington
committed
}
################################# Middleware ###################################
'openedx.core.lib.x_forwarded_for.middleware.XForwardedForMiddleware',
'crum.CurrentRequestUserMiddleware',
# A newer and safer request cache.
'edx_django_utils.cache.middleware.RequestCacheMiddleware',
'edx_django_utils.monitoring.middleware.MonitoringMemoryMiddleware',
# Cookie monitoring
'openedx.core.lib.request_utils.CookieMetricsMiddleware',
'openedx.core.djangoapps.header_control.middleware.HeaderControlMiddleware',
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.sites.middleware.CurrentSiteMiddleware',
'edx_rest_framework_extensions.auth.jwt.middleware.JwtAuthCookieMiddleware',
# Allows us to define redirects via Django admin
'django_sites_extensions.middleware.RedirectMiddleware',
# Instead of SessionMiddleware, we use a more secure version
# 'django.contrib.sessions.middleware.SessionMiddleware',
'openedx.core.djangoapps.safe_sessions.middleware.SafeSessionMiddleware',
'method_override.middleware.MethodOverrideMiddleware',
# Instead of AuthenticationMiddleware, we use a cache-backed version
'openedx.core.djangoapps.cache_toolbox.middleware.CacheBackedAuthenticationMiddleware',
'student.middleware.UserStandingMiddleware',
'openedx.core.djangoapps.contentserver.middleware.StaticContentServer',
'django.contrib.messages.middleware.MessageMiddleware',
'track.middleware.TrackMiddleware',
'openedx.core.djangoapps.lang_pref.middleware.LanguagePreferenceMiddleware',
# Allows us to dark-launch particular languages
'openedx.core.djangoapps.dark_lang.middleware.DarkLangMiddleware',
'openedx.core.djangoapps.embargo.middleware.EmbargoMiddleware',
# Detects user-requested locale from 'accept-language' header in http request
'django.middleware.locale.LocaleMiddleware',
'codejail.django_integration.ConfigureCodeJailMiddleware',
# catches any uncaught RateLimitExceptions and returns a 403 instead of a 500
'ratelimitbackend.middleware.RateLimitMiddleware',
# for expiring inactive sessions
'openedx.core.djangoapps.session_inactivity_timeout.middleware.SessionInactivityTimeout',
'openedx.core.djangoapps.theming.middleware.CurrentSiteThemeMiddleware',
# use Django built in clickjacking protection
'django.middleware.clickjacking.XFrameOptionsMiddleware',
Douglas Hall
committed
# Enables force_django_cache_miss functionality for TieredCache.
'edx_django_utils.cache.middleware.TieredCacheMiddleware',
# Outputs monitoring metrics for a request.
'edx_rest_framework_extensions.middleware.RequestMetricsMiddleware',
'edx_rest_framework_extensions.auth.jwt.middleware.EnsureJWTAuthSettingsMiddleware',
# Handles automatically storing user ids in django-simple-history tables when possible.
'simple_history.middleware.HistoryRequestMiddleware',
Douglas Hall
committed
# This must be last so that it runs first in the process_response chain
'openedx.core.djangoapps.site_configuration.middleware.SessionCookieDomainOverrideMiddleware',
Jesse Shapiro
committed
]
EXTRA_MIDDLEWARE_CLASSES = []
# Clickjacking protection can be disabled by setting this to 'ALLOW'
X_FRAME_OPTIONS = 'DENY'
Dmitry Viskov
committed
# Platform for Privacy Preferences header
P3P_HEADER = 'CP="Open EdX does not have a P3P policy."'
# Import after sys.path fixup
John Eskew
committed
from xmodule.modulestore.inheritance import InheritanceMixin
from xmodule.modulestore import prefer_xmodules
from xmodule.x_module import XModuleMixin
# These are the Mixins that should be added to every XBlock.
# This should be moved into an XBlock Runtime/Application object
# once the responsibility of XBlock creation is moved out of modulestore - cpennington
XBLOCK_MIXINS = (
LmsBlockMixin,
InheritanceMixin,
XModuleMixin,
EditInfoMixin,
AuthoringMixin,
)
XBLOCK_SELECT_FUNCTION = prefer_xmodules
# Paths to wrapper methods which should be applied to every XBlock's FieldData.
XBLOCK_FIELD_DATA_WRAPPERS = ()
############################ ORA 2 ############################################
# By default, don't use a file prefix
ORA2_FILE_PREFIX = 'default_env-default_deployment/ora2'
# Default File Upload Storage bucket and prefix. Used by the FileUpload Service.
FILE_UPLOAD_STORAGE_BUCKET_NAME = 'SET-ME-PLEASE (ex. bucket-name)'
FILE_UPLOAD_STORAGE_PREFIX = 'submissions_attachments'
############################ Modulestore Configuration ################################
'replicaSet': '',
'user': 'edxapp',
'port': 27017,
'ssl': False,
# https://api.mongodb.com/python/2.9.1/api/pymongo/mongo_client.html#module-pymongo.mongo_client
# default is never timeout while the connection is open,
#this means it needs to explicitly close raising pymongo.errors.NetworkTimeout
'socketTimeoutMS': 3000,
'connectTimeoutMS': 2000, # default is 20000, I believe raises pymongo.errors.ConnectionFailure
# Not setting waitQueueTimeoutMS and waitQueueMultiple since pymongo defaults to nobody being allowed to wait
'auth_source': None,
'read_preference': 'PRIMARY'
# If 'asset_collection' defined, it'll be used
# as the collection name for asset metadata.
# Otherwise, a default collection name will be used.
}
CONTENTSTORE = {
'ENGINE': 'xmodule.contentstore.mongo.MongoContentStore',
# connection strings are duplicated temporarily for
# backward compatibility
'OPTIONS': {
'db': 'edxapp',
'host': 'localhost',
'ssl': False,
'auth_source': None
},
'ADDITIONAL_OPTIONS': {},
'DOC_STORE_CONFIG': DOC_STORE_CONFIG
}
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
MODULESTORE = {
'default': {
'ENGINE': 'xmodule.modulestore.mixed.MixedModuleStore',
'OPTIONS': {
'mappings': {},
'stores': [
{
'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',
}
},
{
'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',
}
}
]
}
}
}
# Modulestore-level field override providers. These field override providers don't
# require student context.
MODULESTORE_FIELD_OVERRIDE_PROVIDERS = ()
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
DATABASES = {
# edxapp's edxapp-migrate scripts and the edxapp_migrate play
# will ensure that any DB not named read_replica will be migrated
# for both the lms and cms.
'default': {
'ATOMIC_REQUESTS': True,
'CONN_MAX_AGE': 0,
'ENGINE': 'django.db.backends.mysql',
'HOST': 'localhost',
'NAME': 'edxapp',
'OPTIONS': {},
'PASSWORD': 'password',
'PORT': '3306',
'USER': 'edxapp001'
},
'read_replica': {
'CONN_MAX_AGE': 0,
'ENGINE': 'django.db.backends.mysql',
'HOST': 'localhost',
'NAME': 'dxapp',
'OPTIONS': {},
'PASSWORD': 'password',
'PORT': '3306',
'USER': 'edxapp001'
},
'student_module_history': {
'CONN_MAX_AGE': 0,
'ENGINE': 'django.db.backends.mysql',
'HOST': 'localhost',
'NAME': 'edxapp_csmh',
'OPTIONS': {},
'PASSWORD': 'password',
'PORT': '3306',
#################### Python sandbox ############################################
CODE_JAIL = {
# from https://github.com/edx/codejail/blob/master/codejail/django_integration.py#L24, '' should be same as None
'python_bin': '/edx/app/edxapp/venvs/edxapp-sandbox/bin/python',
# User to run as in the sandbox.
'user': 'sandbox',
# Configurable limits.
'limits': {
# How many CPU seconds can jailed code use?
'CPU': 1,
# Limit the memory of the jailed process to something high but not
# infinite (512MiB in bytes)
'VMEM': 536870912,
# Time in seconds that the jailed process has to run.
'REALTIME': 3,
'PROXY': 0,
# Needs to be non-zero so that jailed code can use it as their temp directory.(1MiB in bytes)
'FSIZE': 1048576,
# 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 = []
############################ DJANGO_BUILTINS ################################
# Change DEBUG in your environment settings files, not here
SESSION_COOKIE_SECURE = False
SESSION_SAVE_EVERY_REQUEST = False
SESSION_SERIALIZER = 'openedx.core.lib.session_serializers.PickleSerializer'
SESSION_COOKIE_DOMAIN = ""
SESSION_COOKIE_NAME = 'sessionid'
COURSE_IMPORT_EXPORT_BUCKET = ''
ALTERNATE_WORKER_QUEUES = 'lms'
STATIC_URL_BASE = '/static/'
X_FRAME_OPTIONS = 'DENY'
GIT_REPO_EXPORT_DIR = '/edx/var/edxapp/export_course_repos'
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'localhost'
EMAIL_PORT = 25
EMAIL_USE_TLS = False
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
DEFAULT_FROM_EMAIL = 'registration@example.com'
DEFAULT_FEEDBACK_EMAIL = 'feedback@example.com'
TECH_SUPPORT_EMAIL = 'technical@example.com'
CONTACT_EMAIL = 'info@example.com'
BUGS_EMAIL = 'bugs@example.com'
SERVER_EMAIL = 'devops@example.com'
UNIVERSITY_EMAIL = 'university@example.com'
PRESS_EMAIL = 'press@example.com'
ADMINS = []
MANAGERS = ADMINS
# Initialize to 'release', but read from JSON in production.py
EDX_PLATFORM_REVISION = 'release'
STATIC_URL = '/static/studio/'
STATIC_ROOT = ENV_ROOT / "staticfiles" / 'studio'
STATICFILES_DIRS = [
COMMON_ROOT / "static",
PROJECT_ROOT / "static",
# This is how you would use the textbook images locally
Calen Pennington
committed
# ("book", ENV_ROOT / "book_images"),
]
# Locale/Internationalization
LANGUAGE_CODE = 'en' # http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGES_BIDI = lms.envs.common.LANGUAGES_BIDI
LANGUAGE_COOKIE = lms.envs.common.LANGUAGE_COOKIE
LANGUAGES = lms.envs.common.LANGUAGES
LANGUAGE_DICT = dict(LANGUAGES)
# Languages supported for custom course certificate templates
CERTIFICATE_TEMPLATE_LANGUAGES = {
'en': 'English',
'es': 'Español',
}
USE_L10N = True
STATICI18N_FILENAME_FUNCTION = 'statici18n.utils.legacy_filename'
STATICI18N_ROOT = PROJECT_ROOT / "static"
LOCALE_PATHS = _make_locale_paths
derived('LOCALE_PATHS')
# Messages
MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
COURSE_IMPORT_EXPORT_STORAGE = 'django.core.files.storage.FileSystemStorage'
##### EMBARGO #####
EMBARGO_SITE_REDIRECT_URL = None
############################### PIPELINE #######################################
PIPELINE = {
'PIPELINE_ENABLED': True,
# Don't use compression by default
'CSS_COMPRESSOR': None,
'JS_COMPRESSOR': None,
# Don't wrap JavaScript as there is code that depends upon updating the global namespace
'DISABLE_WRAPPER': True,
# Specify the UglifyJS binary to use
'UGLIFYJS_BINARY': 'node_modules/.bin/uglifyjs',
'COMPILERS': (),
'YUI_BINARY': 'yui-compressor',
}
STATICFILES_STORAGE = 'openedx.core.storage.ProductionStorage'
Calen Pennington
committed
STATICFILES_STORAGE_KWARGS = {}
# List of finder classes that know how to find static files in various locations.
# Note: the pipeline finder is included to be able to discover optimized files
STATICFILES_FINDERS = [
'openedx.core.djangoapps.theming.finders.ThemeFilesFinder',
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'openedx.core.lib.xblock_pipeline.finder.XBlockPipelineFinder',
'pipeline.finders.PipelineFinder',
]
from openedx.core.lib.rooted_paths import rooted_glob
Calen Pennington
committed
Brian Talbot
committed
'style-vendor': {
Brian Talbot
committed
'css/vendor/normalize.css',
'css/vendor/font-awesome.css',
Frances Botsford
committed
'css/vendor/html5-input-polyfills/number-polyfill.css',
'js/vendor/CodeMirror/codemirror.css',
'css/vendor/ui-lightness/jquery-ui-1.8.22.custom.css',
'css/vendor/jquery.qtip.min.css',
Brian Talbot
committed
'js/vendor/markitup/skins/simple/style.css',
'js/vendor/markitup/sets/wiki/style.css',
Brian Talbot
committed
'output_filename': 'css/cms-style-vendor.css',
},
'style-vendor-tinymce-content': {
'source_filenames': [
Brian Talbot
committed
'css/tinymce-studio-content-fonts.css',
'js/vendor/tinymce/js/tinymce/skins/studio-tmce4/content.min.css',
'css/tinymce-studio-content.css'
],
'output_filename': 'css/cms-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/cms-style-vendor-tinymce-skin.css',
},
'css/studio-main-v1.css',
'output_filename': 'css/studio-main-v1.css',
'css/studio-main-v1-rtl.css',
'output_filename': 'css/studio-main-v1-rtl.css',
},
'style-main-v2': {
'source_filenames': [
'css/studio-main-v2.css',
],
'output_filename': 'css/studio-main-v2.css',