|
45 | 45 |
|
46 | 46 | from corsheaders.defaults import default_headers as corsheaders_default_headers |
47 | 47 | from datetime import timedelta |
| 48 | + |
| 49 | +from django.utils.translation import gettext_lazy as _ |
| 50 | + |
48 | 51 | import lms.envs.common |
49 | | -# Although this module itself may not use these imported variables, other dependent modules may. |
50 | | -# Warning: Do NOT add any new variables to this list. This is incompatible with future plans to |
51 | | -# have more logical separation between LMS and Studio (CMS). It is also incompatible with the |
52 | | -# direction documented in OEP-45: Configuring and Operating Open edX: |
53 | | -# https://open-edx-proposals.readthedocs.io/en/latest/oep-0045-arch-ops-and-config.html |
54 | | -from lms.envs.common import ( |
55 | | - USE_TZ, ALL_LANGUAGES, ASSET_IGNORE_REGEX, |
56 | | - PARENTAL_CONSENT_AGE_LIMIT, REGISTRATION_EMAIL_PATTERNS_ALLOWED, |
57 | | - # The following PROFILE_IMAGE_* settings are included as they are |
58 | | - # indirectly accessed through the email opt-in API, which is |
59 | | - # technically accessible through the CMS via legacy URLs. |
60 | | - PROFILE_IMAGE_BACKEND, PROFILE_IMAGE_DEFAULT_FILENAME, PROFILE_IMAGE_DEFAULT_FILE_EXTENSION, |
61 | | - PROFILE_IMAGE_HASH_SEED, PROFILE_IMAGE_MIN_BYTES, PROFILE_IMAGE_MAX_BYTES, PROFILE_IMAGE_SIZES_MAP, |
62 | | - # The following setting is included as it is used to check whether to |
63 | | - # display credit eligibility table on the CMS or not. |
64 | | - COURSE_MODE_DEFAULTS, DEFAULT_COURSE_ABOUT_IMAGE_URL, |
65 | | - |
66 | | - # User-uploaded content |
67 | | - MEDIA_ROOT, |
68 | | - MEDIA_URL, |
69 | | - |
70 | | - # Lazy Gettext |
71 | | - _, |
72 | | - |
73 | | - # Django REST framework configuration |
74 | | - REST_FRAMEWORK, |
75 | | - |
76 | | - STATICI18N_OUTPUT_DIR, |
77 | | - |
78 | | - # Heartbeat |
79 | | - HEARTBEAT_CHECKS, |
80 | | - HEARTBEAT_EXTENDED_CHECKS, |
81 | | - HEARTBEAT_CELERY_TIMEOUT, |
82 | | - HEARTBEAT_CELERY_ROUTING_KEY, |
83 | | - |
84 | | - # Default site to use if no site exists matching request headers |
85 | | - SITE_ID, |
86 | | - |
87 | | - # constants for redirects app |
88 | | - REDIRECT_CACHE_TIMEOUT, |
89 | | - REDIRECT_CACHE_KEY_PREFIX, |
90 | | - |
91 | | - # This is required for the migrations in oauth_dispatch.models |
92 | | - # otherwise it fails saying this attribute is not present in Settings |
93 | | - # Although Studio does not enable OAuth2 Provider capability, the new approach |
94 | | - # to generating test databases will discover and try to create all tables |
95 | | - # and this setting needs to be present |
96 | | - OAUTH2_PROVIDER_APPLICATION_MODEL, |
97 | | - JWT_AUTH, |
98 | | - |
99 | | - USERNAME_REGEX_PARTIAL, |
100 | | - USERNAME_PATTERN, |
101 | | - |
102 | | - # django-debug-toolbar |
103 | | - DEBUG_TOOLBAR_PATCH_SETTINGS, |
104 | | - |
105 | | - COURSE_ENROLLMENT_MODES, |
106 | | - CONTENT_TYPE_GATE_GROUP_IDS, |
107 | | - |
108 | | - DISABLE_ACCOUNT_ACTIVATION_REQUIREMENT_SWITCH, |
109 | | - |
110 | | - GENERATE_PROFILE_SCORES, |
111 | | - |
112 | | - # Enterprise service settings |
113 | | - ENTERPRISE_CATALOG_INTERNAL_ROOT_URL, |
114 | | - ENTERPRISE_BACKEND_SERVICE_EDX_OAUTH2_KEY, |
115 | | - ENTERPRISE_BACKEND_SERVICE_EDX_OAUTH2_SECRET, |
116 | | - ENTERPRISE_BACKEND_SERVICE_EDX_OAUTH2_PROVIDER_URL, |
117 | | - |
118 | | - # Methods to derive settings |
119 | | - _make_mako_template_dirs, |
120 | | - _make_locale_paths, |
121 | | - |
122 | | - # Password Validator Settings |
123 | | - AUTH_PASSWORD_VALIDATORS |
124 | | -) |
| 52 | + |
| 53 | +from openedx.core.constants import COURSE_KEY_REGEX, COURSE_KEY_PATTERN, COURSE_ID_PATTERN |
| 54 | +from openedx.envs.common import * # pylint: disable=wildcard-import |
| 55 | + |
125 | 56 | from lms.envs.common import ( |
| 57 | + # NOTE: Do not add any new imports here. Use openedx.envs.common instead for |
| 58 | + # platform wide settings. |
| 59 | + |
126 | 60 | # FIXME: The HIBP settings are only used in the LMS, but CMS unit tests fail |
127 | 61 | # without them. Perhaps moving some code would allow us to remove these from |
128 | | - # this file. |
| 62 | + # this file. GitHub Issue: https://github.com/openedx/edx-platform/issues/36992. |
129 | 63 | ENABLE_AUTHN_LOGIN_BLOCK_HIBP_POLICY, |
130 | 64 | ENABLE_AUTHN_LOGIN_NUDGE_HIBP_POLICY, |
131 | 65 | ENABLE_AUTHN_REGISTER_HIBP_POLICY, |
132 | 66 | ENABLE_AUTHN_RESET_PASSWORD_HIBP_POLICY, |
133 | 67 | HIBP_LOGIN_BLOCK_PASSWORD_FREQUENCY_THRESHOLD, |
134 | 68 | HIBP_LOGIN_NUDGE_PASSWORD_FREQUENCY_THRESHOLD, |
135 | 69 | HIBP_REGISTRATION_PASSWORD_FREQUENCY_THRESHOLD, |
136 | | - |
137 | | - USE_EXTRACTED_WORD_CLOUD_BLOCK, |
138 | | - USE_EXTRACTED_ANNOTATABLE_BLOCK, |
139 | | - USE_EXTRACTED_POLL_QUESTION_BLOCK, |
140 | | - USE_EXTRACTED_LTI_BLOCK, |
141 | | - USE_EXTRACTED_HTML_BLOCK, |
142 | | - USE_EXTRACTED_DISCUSSION_BLOCK, |
143 | | - USE_EXTRACTED_PROBLEM_BLOCK, |
144 | | - USE_EXTRACTED_VIDEO_BLOCK, |
145 | 70 | ) |
146 | 71 | from path import Path as path |
147 | 72 | from django.urls import reverse_lazy |
|
700 | 625 | # Don't look for template source files inside installed applications. |
701 | 626 | 'APP_DIRS': False, |
702 | 627 | # Instead, look for template source files in these dirs. |
703 | | - 'DIRS': Derived(_make_mako_template_dirs), |
| 628 | + 'DIRS': Derived(make_mako_template_dirs), |
704 | 629 | # Options specific to this backend. |
705 | 630 | 'OPTIONS': { |
706 | 631 | 'loaders': ( |
|
719 | 644 | 'NAME': 'mako', |
720 | 645 | 'BACKEND': 'common.djangoapps.edxmako.backend.Mako', |
721 | 646 | 'APP_DIRS': False, |
722 | | - 'DIRS': Derived(_make_mako_template_dirs), |
| 647 | + 'DIRS': Derived(make_mako_template_dirs), |
723 | 648 | 'OPTIONS': { |
724 | 649 | 'context_processors': CONTEXT_PROCESSORS, |
725 | 650 | 'debug': False, |
|
823 | 748 | } |
824 | 749 | ] |
825 | 750 |
|
826 | | -# These are standard regexes for pulling out info like course_ids, usage_ids, etc. |
827 | | -# They are used so that URLs with deprecated-format strings still work. |
828 | | -from lms.envs.common import ( |
829 | | - COURSE_KEY_PATTERN, COURSE_KEY_REGEX, COURSE_ID_PATTERN, USAGE_KEY_PATTERN, ASSET_KEY_PATTERN |
830 | | -) |
831 | | - |
832 | 751 | ######################### CSRF ######################################### |
833 | 752 |
|
834 | 753 | # Forwards-compatibility with Django 1.7 |
|
1254 | 1173 | CELERY_TIMEZONE = 'UTC' |
1255 | 1174 | TIME_ZONE = 'UTC' |
1256 | 1175 | LANGUAGE_CODE = 'en' # http://www.i18nguy.com/unicode/language-identifiers.html |
1257 | | -LANGUAGES_BIDI = lms.envs.common.LANGUAGES_BIDI |
1258 | | - |
1259 | | -LANGUAGE_COOKIE_NAME = lms.envs.common.LANGUAGE_COOKIE_NAME |
1260 | | - |
1261 | | -LANGUAGES = lms.envs.common.LANGUAGES |
1262 | | -LANGUAGE_DICT = dict(LANGUAGES) |
1263 | 1176 |
|
1264 | 1177 | # Languages supported for custom course certificate templates |
1265 | 1178 | CERTIFICATE_TEMPLATE_LANGUAGES = { |
|
1273 | 1186 | STATICI18N_FILENAME_FUNCTION = 'statici18n.utils.legacy_filename' |
1274 | 1187 | STATICI18N_ROOT = PROJECT_ROOT / "static" |
1275 | 1188 |
|
1276 | | -LOCALE_PATHS = Derived(_make_locale_paths) |
1277 | | - |
1278 | 1189 | # Messages |
1279 | 1190 | MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage' |
1280 | 1191 |
|
|
1540 | 1451 | CELERY_BROKER_USE_SSL = False |
1541 | 1452 | CELERY_EVENT_QUEUE_TTL = None |
1542 | 1453 |
|
| 1454 | +############################## HEARTBEAT ###################################### |
| 1455 | + |
| 1456 | +HEARTBEAT_CELERY_ROUTING_KEY = HIGH_PRIORITY_QUEUE |
| 1457 | + |
1543 | 1458 | ############################## Video ########################################## |
1544 | 1459 |
|
1545 | 1460 | YOUTUBE = { |
|
0 commit comments