コード例 #1
0
 def setUp(self):
     super(ConfigurationModelAPITests, self).setUp()
     self.factory = APIRequestFactory()
     self.user = User.objects.create_user(
         username='******',
         email='*****@*****.**',
         password='******',
     )
     self.user.is_superuser = True
     self.user.save()
     self.current_view = ConfigurationModelCurrentAPIView.as_view(
         model=ExampleConfig)
コード例 #2
0
ファイル: tests.py プロジェクト: 10clouds/edx-platform
    def setUp(self):
        super(ConfigurationModelAPITests, self).setUp()
        self.factory = APIRequestFactory()
        self.user = User.objects.create_user(
            username='******',
            email='*****@*****.**',
            password='******',
        )
        self.user.is_superuser = True
        self.user.save()

        self.current_view = ConfigurationModelCurrentAPIView.as_view(model=ExampleConfig)

        # Disable caching while testing the API
        patcher = patch('config_models.models.cache', Mock(get=Mock(return_value=None)))
        patcher.start()
        self.addCleanup(patcher.stop)
コード例 #3
0
    def setUp(self):
        super(ConfigurationModelAPITests, self).setUp()
        self.factory = APIRequestFactory()
        self.user = User.objects.create_user(
            username='******',
            email='*****@*****.**',
            password='******',
        )
        self.user.is_superuser = True
        self.user.save()

        self.current_view = ConfigurationModelCurrentAPIView.as_view(model=ExampleConfig)

        # Disable caching while testing the API
        patcher = patch('config_models.models.cache', Mock(get=Mock(return_value=None)))
        patcher.start()
        self.addCleanup(patcher.stop)
コード例 #4
0
    urlpatterns += [
        url(r'^courses/{}/'.format(settings.COURSE_ID_PATTERN),
            include('ccx.urls')),
        url(r'^api/ccx/',
            include('lms.djangoapps.ccx.api.urls', namespace='ccx_api')),
    ]

# Access to courseware as an LTI provider
if settings.FEATURES.get('ENABLE_LTI_PROVIDER'):
    urlpatterns += [
        url(r'^lti_provider/', include('lti_provider.urls')),
    ]

urlpatterns += [
    url(r'config/self_paced',
        ConfigurationModelCurrentAPIView.as_view(
            model=SelfPacedConfiguration)),
    url(r'config/programs',
        ConfigurationModelCurrentAPIView.as_view(model=ProgramsApiConfig)),
    url(r'config/catalog',
        ConfigurationModelCurrentAPIView.as_view(model=CatalogIntegration)),
    url(r'config/forums',
        ConfigurationModelCurrentAPIView.as_view(model=ForumsConfig)),
]

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
    urlpatterns += static(
        settings.PROFILE_IMAGE_BACKEND['options']['base_url'],
コード例 #5
0
# Custom courses on edX (CCX) URLs
if settings.FEATURES['CUSTOM_COURSES_EDX']:
    urlpatterns += [
        url(r'^courses/{}/'.format(settings.COURSE_ID_PATTERN),
            include('ccx.urls')),
        url(r'^api/ccx/', include('lms.djangoapps.ccx.api.urls', namespace='ccx_api')),
    ]

# Access to courseware as an LTI provider
if settings.FEATURES.get('ENABLE_LTI_PROVIDER'):
    urlpatterns += [
        url(r'^lti_provider/', include('lti_provider.urls')),
    ]

urlpatterns += [
    url(r'config/self_paced', ConfigurationModelCurrentAPIView.as_view(model=SelfPacedConfiguration)),
    url(r'config/programs', ConfigurationModelCurrentAPIView.as_view(model=ProgramsApiConfig)),
    url(r'config/catalog', ConfigurationModelCurrentAPIView.as_view(model=CatalogIntegration)),
    url(r'config/forums', ConfigurationModelCurrentAPIView.as_view(model=ForumsConfig)),
]

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
    urlpatterns += static(
        settings.PROFILE_IMAGE_BACKEND['options']['base_url'],
        document_root=settings.PROFILE_IMAGE_BACKEND['options']['location']
    )

# UX reference templates
urlpatterns += [
コード例 #6
0
        document_root=settings.VIDEO_TRANSCRIPTS_SETTINGS['STORAGE_KWARGS']
        ['location'])

if 'debug_toolbar' in settings.INSTALLED_APPS:
    import debug_toolbar
    urlpatterns.append(url(r'^__debug__/', include(debug_toolbar.urls)))

# UX reference templates
urlpatterns.append(
    url(r'^template/(?P<template>.+)$',
        openedx.core.djangoapps.debug.views.show_reference_template,
        name='openedx.core.djangoapps.debug.views.show_reference_template'))

urlpatterns += [
    url(r'config/assets',
        ConfigurationModelCurrentAPIView.as_view(model=NewAssetsPageFlag)),
]

# Custom error pages
# These are used by Django to render these error codes. Do not remove.
# pylint: disable=invalid-name
handler404 = contentstore.views.render_404
handler500 = contentstore.views.render_500

# display error page templates, for testing purposes
urlpatterns += [
    url(r'^404$', handler404),
    url(r'^500$', handler500),
]

from openedx.core.djangoapps.plugins import constants as plugin_constants, plugin_urls
コード例 #7
0
ファイル: urls.py プロジェクト: andela-tadesanya/edx-platform
# Custom courses on edX (CCX) URLs
if settings.FEATURES["CUSTOM_COURSES_EDX"]:
    urlpatterns += (
        url(r'^courses/{}/'.format(settings.COURSE_ID_PATTERN),
            include('ccx.urls')),
    )

# Access to courseware as an LTI provider
if settings.FEATURES.get("ENABLE_LTI_PROVIDER"):
    urlpatterns += (
        url(r'^lti_provider/', include('lti_provider.urls')),
    )

urlpatterns += (
    url(r'config/self_paced', ConfigurationModelCurrentAPIView.as_view(model=SelfPacedConfiguration)),
    url(r'config/programs', ConfigurationModelCurrentAPIView.as_view(model=ProgramsApiConfig)),
)

urlpatterns = patterns(*urlpatterns)

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
    urlpatterns += static(
        settings.PROFILE_IMAGE_BACKEND['options']['base_url'],
        document_root=settings.PROFILE_IMAGE_BACKEND['options']['location']
    )

    # in debug mode, allow any template to be rendered (most useful for UX reference templates)
    urlpatterns += url(r'^template/(?P<template>.+)$', 'debug.views.show_reference_template'),
コード例 #8
0
ファイル: urls.py プロジェクト: EMKF/fasttrac-edx-platform
urlpatterns += (
    url(r'^affiliates/',
        include('lms.djangoapps.affiliates.urls', namespace='affiliates')),
    url(
        r'^api/affiliates/',
        include('lms.djangoapps.affiliates.api.urls',
                namespace='affiliates_api')),
)

# Access to courseware as an LTI provider
if settings.FEATURES.get("ENABLE_LTI_PROVIDER"):
    urlpatterns += (url(r'^lti_provider/', include('lti_provider.urls')), )

urlpatterns += (
    url(r'config/self_paced',
        ConfigurationModelCurrentAPIView.as_view(
            model=SelfPacedConfiguration)),
    url(r'config/programs',
        ConfigurationModelCurrentAPIView.as_view(model=ProgramsApiConfig)),
)

urlpatterns = patterns(*urlpatterns)

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
    urlpatterns += static(
        settings.PROFILE_IMAGE_BACKEND['options']['base_url'],
        document_root=settings.PROFILE_IMAGE_BACKEND['options']['location'])
コード例 #9
0
ファイル: urls.py プロジェクト: agaylard/edx-platform
    url(r"^update_example_certificate$", "certificates.views.update_example_certificate"),
    url(r"^request_certificate$", "certificates.views.request_certificate"),
)

# XDomain proxy
urlpatterns += (url(r"^xdomain_proxy.html$", "cors_csrf.views.xdomain_proxy", name="xdomain_proxy"),)

# Custom courses on edX (CCX) URLs
if settings.FEATURES["CUSTOM_COURSES_EDX"]:
    urlpatterns += (url(r"^courses/{}/".format(settings.COURSE_ID_PATTERN), include("ccx.urls")),)

# Access to courseware as an LTI provider
if settings.FEATURES.get("ENABLE_LTI_PROVIDER"):
    urlpatterns += (url(r"^lti_provider/", include("lti_provider.urls")),)

urlpatterns += (url(r"config/self_paced", ConfigurationModelCurrentAPIView.as_view(model=SelfPacedConfiguration)),)

urlpatterns = patterns(*urlpatterns)

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
    urlpatterns += static(
        settings.PROFILE_IMAGE_BACKEND["options"]["base_url"],
        document_root=settings.PROFILE_IMAGE_BACKEND["options"]["location"],
    )

    # in debug mode, allow any template to be rendered (most useful for UX reference templates)
    urlpatterns += (url(r"^template/(?P<template>.+)$", "debug.views.show_reference_template"),)

if "debug_toolbar" in settings.INSTALLED_APPS:
    import debug_toolbar
コード例 #10
0
ファイル: urls.py プロジェクト: yoanyombapro1234/edx-platform
# Custom courses on edX (CCX) URLs
if settings.FEATURES["CUSTOM_COURSES_EDX"]:
    urlpatterns += (
        url(r'^courses/{}/'.format(settings.COURSE_ID_PATTERN),
            include('ccx.urls')),
    )

# Access to courseware as an LTI provider
if settings.FEATURES.get("ENABLE_LTI_PROVIDER"):
    urlpatterns += (
        url(r'^lti_provider/', include('lti_provider.urls')),
    )

urlpatterns += (
    url(r'config/self_paced', ConfigurationModelCurrentAPIView.as_view(model=SelfPacedConfiguration)),
    url(r'config/programs', ConfigurationModelCurrentAPIView.as_view(model=ProgramsApiConfig)),
)

urlpatterns = patterns(*urlpatterns)

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
    urlpatterns += static(
        settings.PROFILE_IMAGE_BACKEND['options']['base_url'],
        document_root=settings.PROFILE_IMAGE_BACKEND['options']['location']
    )

    # in debug mode, allow any template to be rendered (most useful for UX reference templates)
    urlpatterns += url(r'^template/(?P<template>.+)$', 'debug.views.show_reference_template'),
コード例 #11
0
ファイル: urls.py プロジェクト: Stanford-Online/edx-platform
# Custom courses on edX (CCX) URLs
if settings.FEATURES["CUSTOM_COURSES_EDX"]:
    urlpatterns += (
        url(r'^courses/{}/'.format(settings.COURSE_ID_PATTERN),
            include('ccx.urls')),
        url(r'^api/ccx/', include('lms.djangoapps.ccx.api.urls', namespace='ccx_api')),
    )

# Access to courseware as an LTI provider
if settings.FEATURES.get("ENABLE_LTI_PROVIDER"):
    urlpatterns += (
        url(r'^lti_provider/', include('lti_provider.urls')),
    )

urlpatterns += (
    url(r'config/self_paced', ConfigurationModelCurrentAPIView.as_view(model=SelfPacedConfiguration)),
    url(r'config/programs', ConfigurationModelCurrentAPIView.as_view(model=ProgramsApiConfig)),
    url(r'config/catalog', ConfigurationModelCurrentAPIView.as_view(model=CatalogIntegration)),
    url(r'config/forums', ConfigurationModelCurrentAPIView.as_view(model=ForumsConfig)),
)

urlpatterns = patterns(*urlpatterns)

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
    urlpatterns += static(
        settings.PROFILE_IMAGE_BACKEND['options']['base_url'],
        document_root=settings.PROFILE_IMAGE_BACKEND['options']['location']
    )
コード例 #12
0
ファイル: urls.py プロジェクト: naihe138/edx-platform
# Custom courses on edX (CCX) URLs
if settings.FEATURES["CUSTOM_COURSES_EDX"]:
    urlpatterns += (
        url(r'^courses/{}/'.format(settings.COURSE_ID_PATTERN),
            include('ccx.urls')),
    )

# Access to courseware as an LTI provider
if settings.FEATURES.get("ENABLE_LTI_PROVIDER"):
    urlpatterns += (
        url(r'^lti_provider/', include('lti_provider.urls')),
    )

urlpatterns += (
    url(r'config/self_paced', ConfigurationModelCurrentAPIView.as_view(model=SelfPacedConfiguration)),
)

urlpatterns = patterns(*urlpatterns)

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
    urlpatterns += static(
        settings.PROFILE_IMAGE_BACKEND['options']['base_url'],
        document_root=settings.PROFILE_IMAGE_BACKEND['options']['location']
    )

    # in debug mode, allow any template to be rendered (most useful for UX reference templates)
    urlpatterns += url(r'^template/(?P<template>.+)$', 'debug.views.show_reference_template'),

if 'debug_toolbar' in settings.INSTALLED_APPS:
コード例 #13
0
ファイル: urls.py プロジェクト: charany1/edx-platform
urlpatterns += (url(r'^xdomain_proxy.html$',
                    'cors_csrf.views.xdomain_proxy',
                    name='xdomain_proxy'), )

# Custom courses on edX (CCX) URLs
if settings.FEATURES["CUSTOM_COURSES_EDX"]:
    urlpatterns += (url(r'^courses/{}/'.format(settings.COURSE_ID_PATTERN),
                        include('ccx.urls')), )

# Access to courseware as an LTI provider
if settings.FEATURES.get("ENABLE_LTI_PROVIDER"):
    urlpatterns += (url(r'^lti_provider/', include('lti_provider.urls')), )

urlpatterns += (url(
    r'config/self_paced',
    ConfigurationModelCurrentAPIView.as_view(model=SelfPacedConfiguration)), )

urlpatterns = patterns(*urlpatterns)

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
    urlpatterns += static(
        settings.PROFILE_IMAGE_BACKEND['options']['base_url'],
        document_root=settings.PROFILE_IMAGE_BACKEND['options']['location'])

    # in debug mode, allow any template to be rendered (most useful for UX reference templates)
    urlpatterns += url(r'^template/(?P<template>.+)$',
                       'debug.views.show_reference_template'),

if 'debug_toolbar' in settings.INSTALLED_APPS:
コード例 #14
0
# XDomain proxy
urlpatterns += (url(r"^xdomain_proxy.html$", "cors_csrf.views.xdomain_proxy", name="xdomain_proxy"),)

# Custom courses on edX (CCX) URLs
if settings.FEATURES["CUSTOM_COURSES_EDX"]:
    urlpatterns += (
        url(r"^courses/{}/".format(settings.COURSE_ID_PATTERN), include("ccx.urls")),
        url(r"^api/ccx/", include("lms.djangoapps.ccx.api.urls", namespace="ccx_api")),
    )

# Access to courseware as an LTI provider
if settings.FEATURES.get("ENABLE_LTI_PROVIDER"):
    urlpatterns += (url(r"^lti_provider/", include("lti_provider.urls")),)

urlpatterns += (
    url(r"config/self_paced", ConfigurationModelCurrentAPIView.as_view(model=SelfPacedConfiguration)),
    url(r"config/programs", ConfigurationModelCurrentAPIView.as_view(model=ProgramsApiConfig)),
    url(r"config/catalog", ConfigurationModelCurrentAPIView.as_view(model=CatalogIntegration)),
)

urlpatterns = patterns(*urlpatterns)

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
    urlpatterns += static(
        settings.PROFILE_IMAGE_BACKEND["options"]["base_url"],
        document_root=settings.PROFILE_IMAGE_BACKEND["options"]["location"],
    )

urlpatterns += (url(r"^template/(?P<template>.+)$", "openedx.core.djangoapps.debug.views.show_reference_template"),)