Fix more Django 2.0 deprecation warnings around URLconfs.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from django.conf.urls import include, url
|
||||
|
||||
app_name = 'entitlements'
|
||||
urlpatterns = [
|
||||
url(r'^v1/', include('entitlements.api.v1.urls', namespace='v1')),
|
||||
]
|
||||
|
||||
@@ -11,7 +11,7 @@ ENROLLMENTS_VIEW = EntitlementEnrollmentViewSet.as_view({
|
||||
'delete': 'destroy',
|
||||
})
|
||||
|
||||
|
||||
app_name = 'entitlements'
|
||||
urlpatterns = [
|
||||
url(r'', include(router.urls)),
|
||||
url(
|
||||
|
||||
@@ -3,6 +3,7 @@ CCX API URLs.
|
||||
"""
|
||||
from django.conf.urls import include, url
|
||||
|
||||
app_name = 'ccx_api'
|
||||
urlpatterns = [
|
||||
url(r'^v0/', include('lms.djangoapps.ccx.api.v0.urls', namespace='v0')),
|
||||
]
|
||||
|
||||
@@ -8,11 +8,12 @@ from lms.djangoapps.ccx.api.v0 import views
|
||||
|
||||
CCX_COURSE_ID_PATTERN = settings.COURSE_ID_PATTERN.replace('course_id', 'ccx_course_id')
|
||||
|
||||
CCX_URLS = [
|
||||
CCX_URLS = ([
|
||||
url(r'^$', views.CCXListView.as_view(), name='list'),
|
||||
url(r'^{}/?$'.format(CCX_COURSE_ID_PATTERN), views.CCXDetailView.as_view(), name='detail'),
|
||||
]
|
||||
], 'ccx')
|
||||
|
||||
app_name = 'v0'
|
||||
urlpatterns = [
|
||||
url(r'^ccx/', include(CCX_URLS, namespace='ccx')),
|
||||
url(r'^ccx/', include(CCX_URLS)),
|
||||
]
|
||||
|
||||
@@ -3,6 +3,7 @@ Certificates API URLs.
|
||||
"""
|
||||
from django.conf.urls import include, url
|
||||
|
||||
app_name = 'certificates'
|
||||
urlpatterns = [
|
||||
url(r'^v0/', include('lms.djangoapps.certificates.apis.v0.urls', namespace='v0')),
|
||||
]
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.conf.urls import include, url
|
||||
|
||||
from lms.djangoapps.certificates.apis.v0 import views
|
||||
|
||||
CERTIFICATES_URLS = [
|
||||
CERTIFICATES_URLS = ([
|
||||
url(
|
||||
r'^{username}/courses/{course_id}/$'.format(
|
||||
username=settings.USERNAME_PATTERN,
|
||||
@@ -14,8 +14,9 @@ CERTIFICATES_URLS = [
|
||||
),
|
||||
views.CertificatesDetailView.as_view(), name='detail'
|
||||
),
|
||||
]
|
||||
], 'certificates')
|
||||
|
||||
app_name = 'certificates'
|
||||
urlpatterns = [
|
||||
url(r'^certificates/', include(CERTIFICATES_URLS, namespace='certificates')),
|
||||
]
|
||||
|
||||
@@ -6,6 +6,7 @@ from django.conf.urls import url
|
||||
|
||||
from lms.djangoapps.certificates import views
|
||||
|
||||
app_name = 'certificates'
|
||||
urlpatterns = [
|
||||
# Certificates HTML view end point to render web certs by user and course
|
||||
url(
|
||||
|
||||
@@ -3,6 +3,7 @@ API URLs.
|
||||
"""
|
||||
from django.conf.urls import include, url
|
||||
|
||||
app_name = 'commerce'
|
||||
urlpatterns = [
|
||||
url(r'^v0/', include('lms.djangoapps.commerce.api.v0.urls', namespace='v0')),
|
||||
url(r'^v1/', include('lms.djangoapps.commerce.api.v1.urls', namespace='v1')),
|
||||
|
||||
@@ -5,11 +5,12 @@ from django.conf.urls import include, url
|
||||
|
||||
from . import views
|
||||
|
||||
BASKET_URLS = [
|
||||
BASKET_URLS = ([
|
||||
url(r'^$', views.BasketsView.as_view(), name='create'),
|
||||
url(r'^(?P<basket_id>[\w]+)/order/$', views.BasketOrderView.as_view(), name='retrieve_order'),
|
||||
]
|
||||
], 'baskets')
|
||||
|
||||
app_name = 'commerce'
|
||||
urlpatterns = [
|
||||
url(r'^baskets/', include(BASKET_URLS, namespace='baskets')),
|
||||
url(r'^baskets/', include(BASKET_URLS)),
|
||||
]
|
||||
|
||||
@@ -3,16 +3,17 @@ from django.conf.urls import include, url
|
||||
|
||||
from . import views
|
||||
|
||||
COURSE_URLS = [
|
||||
COURSE_URLS = ([
|
||||
url(r'^$', views.CourseListView.as_view(), name='list'),
|
||||
url(r'^{}/$'.format(settings.COURSE_ID_PATTERN), views.CourseRetrieveUpdateView.as_view(), name='retrieve_update'),
|
||||
]
|
||||
], 'courses')
|
||||
|
||||
ORDER_URLS = [
|
||||
ORDER_URLS = ([
|
||||
url(r'^(?P<number>[-\w]+)/$', views.OrderView.as_view(), name='detail'),
|
||||
]
|
||||
], 'orders')
|
||||
|
||||
app_name = 'commerce'
|
||||
urlpatterns = [
|
||||
url(r'^courses/', include(COURSE_URLS, namespace='courses')),
|
||||
url(r'^orders/', include(ORDER_URLS, namespace='orders')),
|
||||
url(r'^courses/', include(COURSE_URLS)),
|
||||
url(r'^orders/', include(ORDER_URLS)),
|
||||
]
|
||||
|
||||
@@ -5,6 +5,7 @@ from django.conf.urls import url
|
||||
|
||||
from . import views
|
||||
|
||||
app_name = 'commerce'
|
||||
urlpatterns = [
|
||||
url(r'^checkout/cancel/$', views.checkout_cancel, name='checkout_cancel'),
|
||||
url(r'^checkout/error/$', views.checkout_error, name='checkout_error'),
|
||||
|
||||
@@ -9,6 +9,7 @@ from .views import CourseGoalViewSet
|
||||
router = routers.DefaultRouter()
|
||||
router.register(r'course_goals', CourseGoalViewSet, base_name='course_goal')
|
||||
|
||||
app_name = 'course_goals'
|
||||
urlpatterns = [
|
||||
url(r'^v0/', include(router.urls, namespace='v0')),
|
||||
]
|
||||
|
||||
@@ -6,6 +6,7 @@ router = routers.DefaultRouter()
|
||||
router.register(r'data', views.ExperimentDataViewSet, base_name='data')
|
||||
router.register(r'key-value', views.ExperimentKeyValueViewSet, base_name='key_value')
|
||||
|
||||
app_name = 'experiments'
|
||||
urlpatterns = [
|
||||
url(r'^v0/', include(router.urls, namespace='v0')),
|
||||
]
|
||||
|
||||
@@ -5,6 +5,7 @@ from django.conf.urls import url
|
||||
|
||||
from rss_proxy.views import proxy
|
||||
|
||||
app_name = 'rss_proxy'
|
||||
urlpatterns = [
|
||||
url(r'^$', proxy, name='proxy'),
|
||||
]
|
||||
|
||||
@@ -13,6 +13,7 @@ from support.views.refund import RefundSupportView
|
||||
|
||||
COURSE_ENTITLEMENTS_VIEW = EntitlementSupportView.as_view()
|
||||
|
||||
app_name = 'support'
|
||||
urlpatterns = [
|
||||
url(r'^$', index, name="index"),
|
||||
url(r'^certificates/?$', CertificatesSupportView.as_view(), name="certificates"),
|
||||
|
||||
@@ -112,7 +112,7 @@ urlpatterns = [
|
||||
url(r'^api/val/v0/', include('edxval.urls')),
|
||||
|
||||
url(r'^api/commerce/', include('commerce.api.urls', namespace='commerce_api')),
|
||||
url(r'^api/credit/', include('openedx.core.djangoapps.credit.urls', app_name='credit', namespace='credit')),
|
||||
url(r'^api/credit/', include('openedx.core.djangoapps.credit.urls', namespace='credit')),
|
||||
url(r'^rss_proxy/', include('rss_proxy.urls', namespace='rss_proxy')),
|
||||
url(r'^api/organizations/', include('organizations.urls', namespace='organizations')),
|
||||
|
||||
@@ -177,7 +177,7 @@ if settings.FEATURES.get('ENABLE_SYSADMIN_DASHBOARD'):
|
||||
]
|
||||
|
||||
urlpatterns += [
|
||||
url(r'^support/', include('support.urls', app_name='support', namespace='support')),
|
||||
url(r'^support/', include('support.urls', namespace='support')),
|
||||
]
|
||||
|
||||
# Favicon
|
||||
@@ -971,7 +971,7 @@ if settings.FEATURES.get('ENABLE_OAUTH2_PROVIDER'):
|
||||
|
||||
# Certificates
|
||||
urlpatterns += [
|
||||
url(r'^certificates/', include('certificates.urls', app_name='certificates', namespace='certificates')),
|
||||
url(r'^certificates/', include('certificates.urls', namespace='certificates')),
|
||||
|
||||
# Backwards compatibility with XQueue, which uses URLs that are not prefixed with /certificates/
|
||||
url(r'^update_certificate$', certificates_views.update_certificate, name='update_certificate'),
|
||||
|
||||
@@ -3,6 +3,7 @@ URL definitions for api access request API.
|
||||
"""
|
||||
from django.conf.urls import include, url
|
||||
|
||||
app_name = 'api_admin'
|
||||
urlpatterns = [
|
||||
url(r'^v1/', include('openedx.core.djangoapps.api_admin.api.v1.urls', namespace='v1')),
|
||||
]
|
||||
|
||||
@@ -5,6 +5,7 @@ from django.conf.urls import url
|
||||
|
||||
from openedx.core.djangoapps.api_admin.api.v1 import views
|
||||
|
||||
app_name = 'api_admin'
|
||||
urlpatterns = [
|
||||
url(r'^api_access_request/$', views.ApiAccessRequestView.as_view(), name='list_api_access_request'),
|
||||
]
|
||||
|
||||
@@ -15,6 +15,7 @@ from openedx.core.djangoapps.api_admin.views import (
|
||||
CatalogSearchView
|
||||
)
|
||||
|
||||
app_name = 'api_admin'
|
||||
urlpatterns = (
|
||||
url(
|
||||
r'^status/$',
|
||||
|
||||
@@ -2,6 +2,7 @@ from django.conf.urls import url
|
||||
|
||||
from . import views
|
||||
|
||||
app_name = 'catalog'
|
||||
urlpatterns = [
|
||||
url(r'^management/cache_programs/$', views.cache_programs, name='cache_programs'),
|
||||
]
|
||||
|
||||
@@ -22,6 +22,7 @@ router.register(r'courses', views.CreditCourseViewSet)
|
||||
router.register(r'providers', views.CreditProviderViewSet)
|
||||
V1_URLS += router.urls
|
||||
|
||||
app_name = 'credit'
|
||||
urlpatterns = [
|
||||
url(r'^v1/', include(V1_URLS)),
|
||||
]
|
||||
|
||||
@@ -6,6 +6,7 @@ from django.conf.urls import url
|
||||
|
||||
from openedx.core.djangoapps.dark_lang import views
|
||||
|
||||
app_name = 'dark_lang'
|
||||
urlpatterns = [
|
||||
url(r'^$', views.PreviewLanguageFragmentView.as_view(), name='preview_lang'),
|
||||
]
|
||||
|
||||
@@ -4,6 +4,7 @@ from django.conf.urls import url
|
||||
|
||||
from .views import CheckCourseAccessView, CourseAccessMessageView
|
||||
|
||||
app_name = 'embargo'
|
||||
urlpatterns = [
|
||||
url(
|
||||
r'^blocked-message/(?P<access_point>enrollment|courseware)/(?P<message_key>.+)/$',
|
||||
|
||||
Reference in New Issue
Block a user