Files
edx-platform/lms/djangoapps/instructor/apps.py
Ned Batchelder 2171ddb9df URL patterns should be anchored. SEC-367
Some notes:

* The completion API was pulled out into a new repo, but left behind a
  url() entry.  That entry used a different namespace than the
  pulled-out repo, so I had to fix the one place we used the namespace.

* Two urls couldn't be anchored because they broke tests:

    url(r'users/(?P<user_id>\w+)/followed$', views.followed_threads, name='followed_threads'),
    url(r'users/(?P<user_id>\w+)$', views.user_profile, name='user_profile'),
2019-04-23 09:19:23 -04:00

40 lines
1.4 KiB
Python

"""
Instructor Application Configuration
"""
from django.apps import AppConfig
from django.conf import settings
from edx_proctoring.runtime import set_runtime_service
from openedx.core.constants import COURSE_ID_PATTERN
from openedx.core.djangoapps.plugins.constants import ProjectType, SettingsType, PluginURLs, PluginSettings
class InstructorConfig(AppConfig):
"""
Application Configuration for Instructor.
"""
name = u'lms.djangoapps.instructor'
plugin_app = {
PluginURLs.CONFIG: {
ProjectType.LMS: {
PluginURLs.NAMESPACE: u'',
PluginURLs.REGEX: u'^courses/{}/instructor/api/'.format(COURSE_ID_PATTERN),
PluginURLs.RELATIVE_PATH: u'views.api_urls',
}
},
PluginSettings.CONFIG: {
ProjectType.LMS: {
SettingsType.DEVSTACK: {PluginSettings.RELATIVE_PATH: u'settings.devstack'},
SettingsType.PRODUCTION: {PluginSettings.RELATIVE_PATH: u'settings.production'},
SettingsType.COMMON: {PluginSettings.RELATIVE_PATH: u'settings.common'},
SettingsType.TEST: {PluginSettings.RELATIVE_PATH: u'settings.test'},
}
}
}
def ready(self):
if settings.FEATURES.get('ENABLE_SPECIAL_EXAMS'):
from .services import InstructorService
set_runtime_service('instructor', InstructorService())