Enable Django App Plugins in CMS

This commit is contained in:
Nimisha Asthagiri
2018-01-08 21:09:07 -05:00
parent c2fc546db9
commit 24d6c314ef
5 changed files with 24 additions and 11 deletions

View File

@@ -36,7 +36,6 @@ CONFIG_ROOT = path(os.environ.get('CONFIG_ROOT', ENV_ROOT))
# prefix.
CONFIG_PREFIX = SERVICE_VARIANT + "." if SERVICE_VARIANT else ""
############### ALWAYS THE SAME ################################
DEBUG = False
@@ -561,6 +560,11 @@ COMPLETION_VIDEO_COMPLETE_PERCENTAGE = ENV_TOKENS.get(
COMPLETION_VIDEO_COMPLETE_PERCENTAGE,
)
####################### Plugin Settings ##########################
from openedx.core.djangolib.django_plugins import DjangoAppRegistry, ProjectType, SettingsType
DjangoAppRegistry.add_plugin_settings(__name__, ProjectType.CMS, SettingsType.AWS)
########################## Derive Any Derived Settings #######################
derive_settings(__name__)

View File

@@ -1008,9 +1008,6 @@ INSTALLED_APPS = [
'require',
'webpack_loader',
# Theming
'openedx.core.djangoapps.theming.apps.ThemingConfig',
# Site configuration for theming and behavioral modification
'openedx.core.djangoapps.site_configuration',
@@ -1123,10 +1120,6 @@ INSTALLED_APPS = [
# Waffle related utilities
'openedx.core.djangoapps.waffle_utils',
# Dynamic schedules
'openedx.core.djangoapps.ace_common.apps.AceCommonConfig',
'openedx.core.djangoapps.schedules.apps.SchedulesConfig',
# DRF filters
'django_filters',
'cms.djangoapps.api',
@@ -1504,3 +1497,10 @@ ZENDESK_CUSTOM_FIELDS = {}
# Once a user has watched this percentage of a video, mark it as complete:
# (0.0 = 0%, 1.0 = 100%)
COMPLETION_VIDEO_COMPLETE_PERCENTAGE = 0.95
############## Installed Django Apps #########################
from openedx.core.djangolib.django_plugins import DjangoAppRegistry, ProjectType, SettingsType
INSTALLED_APPS.extend(DjangoAppRegistry.get_plugin_apps(ProjectType.CMS))
DjangoAppRegistry.add_plugin_settings(__name__, ProjectType.CMS, SettingsType.COMMON)

View File

@@ -143,6 +143,10 @@ JWT_AUTH.update({
'JWT_AUDIENCE': 'lms-key',
})
#####################################################################
from openedx.core.djangolib.django_plugins import DjangoAppRegistry, ProjectType, SettingsType
DjangoAppRegistry.add_plugin_settings(__name__, ProjectType.CMS, SettingsType.DEVSTACK)
###############################################################################
# See if the developer has any local overrides.
if os.path.isfile(join(dirname(abspath(__file__)), 'private.py')):

View File

@@ -353,6 +353,11 @@ VIDEO_TRANSCRIPTS_SETTINGS = dict(
DIRECTORY_PREFIX='video-transcripts/',
)
####################### Plugin Settings ##########################
from openedx.core.djangolib.django_plugins import DjangoAppRegistry, ProjectType, SettingsType
DjangoAppRegistry.add_plugin_settings(__name__, ProjectType.CMS, SettingsType.TEST)
########################## Derive Any Derived Settings #######################
derive_settings(__name__)

View File

@@ -62,9 +62,6 @@ urlpatterns = [
# Darklang View to change the preview language (or dark language)
url(r'^update_lang/', include('openedx.core.djangoapps.dark_lang.urls', namespace='dark_lang')),
# URLs for managing theming
url(r'^theming/', include('openedx.core.djangoapps.theming.urls', namespace='theming')),
# For redirecting to help pages.
url(r'^help_token/', include('help_tokens.urls')),
url(r'^api/', include('cms.djangoapps.api.urls', namespace='api')),
@@ -255,3 +252,6 @@ urlpatterns += [
url(r'^404$', handler404),
url(r'^500$', handler500),
]
from openedx.core.djangolib.django_plugins import DjangoAppRegistry, ProjectType
urlpatterns.extend(DjangoAppRegistry.get_plugin_url_patterns(ProjectType.CMS))