diff --git a/lms/djangoapps/badges/api/urls.py b/lms/djangoapps/badges/api/urls.py index 1164cc9033..5c6afd97b0 100644 --- a/lms/djangoapps/badges/api/urls.py +++ b/lms/djangoapps/badges/api/urls.py @@ -2,11 +2,10 @@ URLs for badges API """ from django.conf import settings -from django.conf.urls import patterns, url +from django.conf.urls import url from .views import UserBadgeAssertions -urlpatterns = patterns( - 'badges.api', +urlpatterns = [ url('^assertions/user/' + settings.USERNAME_PATTERN + '/$', UserBadgeAssertions.as_view(), name='user_assertions'), -) +] diff --git a/lms/djangoapps/branding/api_urls.py b/lms/djangoapps/branding/api_urls.py index d7ba50c012..83044bcca3 100644 --- a/lms/djangoapps/branding/api_urls.py +++ b/lms/djangoapps/branding/api_urls.py @@ -2,14 +2,10 @@ Branding API endpoint urls. """ -from django.conf.urls import patterns, url +from django.conf.urls import url -urlpatterns = patterns( - "", +from branding.views import footer - url( - r"^footer$", - "branding.views.footer", - name="branding_footer", - ), -) +urlpatterns = [ + url(r"^footer$", footer, name="branding_footer"), +] diff --git a/lms/djangoapps/bulk_enroll/urls.py b/lms/djangoapps/bulk_enroll/urls.py index 1aba792f4a..444a304f45 100644 --- a/lms/djangoapps/bulk_enroll/urls.py +++ b/lms/djangoapps/bulk_enroll/urls.py @@ -1,11 +1,10 @@ """ URLs for the Bulk Enrollment API """ -from django.conf.urls import patterns, url +from django.conf.urls import url from bulk_enroll.views import BulkEnrollView -urlpatterns = patterns( - 'bulk_enroll.views', +urlpatterns = [ url(r'^bulk_enroll', BulkEnrollView.as_view(), name='bulk_enroll'), -) +] diff --git a/lms/djangoapps/ccx/api/urls.py b/lms/djangoapps/ccx/api/urls.py index ab19553bce..7e5f0767ce 100644 --- a/lms/djangoapps/ccx/api/urls.py +++ b/lms/djangoapps/ccx/api/urls.py @@ -1,7 +1,8 @@ -""" CCX API URLs. """ -from django.conf.urls import include, patterns, url +""" +CCX API URLs. +""" +from django.conf.urls import include, url -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^v0/', include('lms.djangoapps.ccx.api.v0.urls', namespace='v0')), -) +] diff --git a/lms/djangoapps/ccx/api/v0/urls.py b/lms/djangoapps/ccx/api/v0/urls.py index 8222601952..8a81a1b98c 100644 --- a/lms/djangoapps/ccx/api/v0/urls.py +++ b/lms/djangoapps/ccx/api/v0/urls.py @@ -1,19 +1,18 @@ -""" CCX API v0 URLs. """ - +""" +CCX API v0 URLs. +""" from django.conf import settings -from django.conf.urls import include, patterns, url +from django.conf.urls import include, url from lms.djangoapps.ccx.api.v0 import views CCX_COURSE_ID_PATTERN = settings.COURSE_ID_PATTERN.replace('course_id', 'ccx_course_id') -CCX_URLS = patterns( - '', +CCX_URLS = [ url(r'^$', views.CCXListView.as_view(), name='list'), url(r'^{}/?$'.format(CCX_COURSE_ID_PATTERN), views.CCXDetailView.as_view(), name='detail'), -) +] -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^ccx/', include(CCX_URLS, namespace='ccx')), -) +] diff --git a/lms/djangoapps/ccx/urls.py b/lms/djangoapps/ccx/urls.py index c3c19f13e5..5a25eb29e6 100644 --- a/lms/djangoapps/ccx/urls.py +++ b/lms/djangoapps/ccx/urls.py @@ -1,31 +1,22 @@ """ URLs for the CCX Feature. """ -from django.conf.urls import patterns, url +from django.conf.urls import url -urlpatterns = patterns( - '', - url(r'^ccx_coach$', - 'ccx.views.dashboard', name='ccx_coach_dashboard'), - url(r'^create_ccx$', - 'ccx.views.create_ccx', name='create_ccx'), - url(r'^save_ccx$', - 'ccx.views.save_ccx', name='save_ccx'), - url(r'^ccx_invite$', - 'ccx.views.ccx_invite', name='ccx_invite'), - url(r'^ccx_schedule$', - 'ccx.views.ccx_schedule', name='ccx_schedule'), - url(r'^ccx_manage_student$', - 'ccx.views.ccx_student_management', name='ccx_manage_student'), +import ccx.views + +urlpatterns = [ + url(r'^ccx_coach$', ccx.views.dashboard, name='ccx_coach_dashboard'), + url(r'^create_ccx$', ccx.views.create_ccx, name='create_ccx'), + url(r'^save_ccx$', ccx.views.save_ccx, name='save_ccx'), + url(r'^ccx_invite$', ccx.views.ccx_invite, name='ccx_invite'), + url(r'^ccx_schedule$', ccx.views.ccx_schedule, name='ccx_schedule'), + url(r'^ccx_manage_student$', ccx.views.ccx_student_management, name='ccx_manage_student'), # Grade book - url(r'^ccx_gradebook$', - 'ccx.views.ccx_gradebook', name='ccx_gradebook'), - url(r'^ccx_gradebook/(?P[0-9]+)$', - 'ccx.views.ccx_gradebook', name='ccx_gradebook'), + url(r'^ccx_gradebook$', ccx.views.ccx_gradebook, name='ccx_gradebook'), + url(r'^ccx_gradebook/(?P[0-9]+)$', ccx.views.ccx_gradebook, name='ccx_gradebook'), - url(r'^ccx_grades.csv$', - 'ccx.views.ccx_grades_csv', name='ccx_grades_csv'), - url(r'^ccx_set_grading_policy$', - 'ccx.views.set_grading_policy', name='ccx_set_grading_policy'), -) + url(r'^ccx_grades.csv$', ccx.views.ccx_grades_csv, name='ccx_grades_csv'), + url(r'^ccx_set_grading_policy$', ccx.views.set_grading_policy, name='ccx_set_grading_policy'), +] diff --git a/lms/djangoapps/certificates/apis/urls.py b/lms/djangoapps/certificates/apis/urls.py index 1187761572..5abcec1f77 100644 --- a/lms/djangoapps/certificates/apis/urls.py +++ b/lms/djangoapps/certificates/apis/urls.py @@ -1,7 +1,8 @@ -""" Certificates API URLs. """ -from django.conf.urls import include, patterns, url +""" +Certificates API URLs. +""" +from django.conf.urls import include, url -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^v0/', include('lms.djangoapps.certificates.apis.v0.urls', namespace='v0')), -) +] diff --git a/lms/djangoapps/certificates/apis/v0/urls.py b/lms/djangoapps/certificates/apis/v0/urls.py index 66b28643b9..3fe534851c 100644 --- a/lms/djangoapps/certificates/apis/v0/urls.py +++ b/lms/djangoapps/certificates/apis/v0/urls.py @@ -1,12 +1,12 @@ -""" Certificates API v0 URLs. """ - +""" +Certificates API v0 URLs. +""" from django.conf import settings -from django.conf.urls import include, patterns, url +from django.conf.urls import include, url from lms.djangoapps.certificates.apis.v0 import views -CERTIFICATES_URLS = patterns( - '', +CERTIFICATES_URLS = [ url( r'^{username}/courses/{course_id}/$'.format( username=settings.USERNAME_PATTERN, @@ -14,9 +14,8 @@ CERTIFICATES_URLS = patterns( ), views.CertificatesDetailView.as_view(), name='detail' ), -) +] -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^certificates/', include(CERTIFICATES_URLS, namespace='certificates')), -) +] diff --git a/lms/djangoapps/certificates/urls.py b/lms/djangoapps/certificates/urls.py index 7889f0cefd..9a9181485b 100644 --- a/lms/djangoapps/certificates/urls.py +++ b/lms/djangoapps/certificates/urls.py @@ -1,15 +1,12 @@ """ URLs for the certificates app. """ - from django.conf import settings -from django.conf.urls import patterns, url +from django.conf.urls import url from certificates import views -urlpatterns = patterns( - '', - +urlpatterns = [ # Certificates HTML view end point to render web certs by user and course url( r'^user/(?P[^/]*)/course/{course_id}'.format(course_id=settings.COURSE_ID_PATTERN), @@ -30,4 +27,4 @@ urlpatterns = patterns( url(r'search', views.search_certificates, name="search"), url(r'regenerate', views.regenerate_certificate_for_user, name="regenerate_certificate_for_user"), url(r'generate', views.generate_certificate_for_user, name="generate_certificate_for_user"), -) +] diff --git a/lms/djangoapps/class_dashboard/urls.py b/lms/djangoapps/class_dashboard/urls.py index 8d103a2815..2ebeacb5d5 100644 --- a/lms/djangoapps/class_dashboard/urls.py +++ b/lms/djangoapps/class_dashboard/urls.py @@ -1,35 +1,35 @@ """ Class Dashboard API endpoint urls. """ - from django.conf import settings -from django.conf.urls import patterns, url +from django.conf.urls import url + +import class_dashboard.views +import class_dashboard.dashboard_data COURSE_ID_PATTERN = settings.COURSE_ID_PATTERN -urlpatterns = patterns( - '', - +urlpatterns = [ # Json request data for metrics for entire course url(r'^{}/all_sequential_open_distrib$'.format(settings.COURSE_ID_PATTERN), - 'class_dashboard.views.all_sequential_open_distrib', name="all_sequential_open_distrib"), + class_dashboard.views.all_sequential_open_distrib, name="all_sequential_open_distrib"), url(r'^{}/all_problem_grade_distribution$'.format(settings.COURSE_ID_PATTERN), - 'class_dashboard.views.all_problem_grade_distribution', name="all_problem_grade_distribution"), + class_dashboard.views.all_problem_grade_distribution, name="all_problem_grade_distribution"), # Json request data for metrics for particular section url(r'^{}/problem_grade_distribution/(?P
\d+)$'.format(settings.COURSE_ID_PATTERN), - 'class_dashboard.views.section_problem_grade_distrib', name="section_problem_grade_distrib"), + class_dashboard.views.section_problem_grade_distrib, name="section_problem_grade_distrib"), # For listing students that opened a sub-section url(r'^get_students_opened_subsection$', - 'class_dashboard.dashboard_data.get_students_opened_subsection', name="get_students_opened_subsection"), + class_dashboard.dashboard_data.get_students_opened_subsection, name="get_students_opened_subsection"), # For listing of students' grade per problem url(r'^get_students_problem_grades$', - 'class_dashboard.dashboard_data.get_students_problem_grades', name="get_students_problem_grades"), + class_dashboard.dashboard_data.get_students_problem_grades, name="get_students_problem_grades"), # For generating metrics data as a csv url(r'^post_metrics_data_csv_url', - 'class_dashboard.dashboard_data.post_metrics_data_csv', name="post_metrics_data_csv"), -) + class_dashboard.dashboard_data.post_metrics_data_csv, name="post_metrics_data_csv"), +] diff --git a/lms/djangoapps/commerce/api/urls.py b/lms/djangoapps/commerce/api/urls.py index c12a53ffc8..a8715a738d 100644 --- a/lms/djangoapps/commerce/api/urls.py +++ b/lms/djangoapps/commerce/api/urls.py @@ -1,8 +1,9 @@ -""" API URLs. """ -from django.conf.urls import include, patterns, url +""" +API URLs. +""" +from django.conf.urls import include, url -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^v0/', include('commerce.api.v0.urls', namespace='v0')), url(r'^v1/', include('commerce.api.v1.urls', namespace='v1')), -) +] diff --git a/lms/djangoapps/commerce/api/v0/urls.py b/lms/djangoapps/commerce/api/v0/urls.py index 90fd9f1845..601df846e8 100644 --- a/lms/djangoapps/commerce/api/v0/urls.py +++ b/lms/djangoapps/commerce/api/v0/urls.py @@ -1,15 +1,15 @@ -""" API v0 URLs. """ -from django.conf.urls import include, patterns, url +""" +API v0 URLs. +""" +from django.conf.urls import include, url from commerce.api.v0 import views -BASKET_URLS = patterns( - '', +BASKET_URLS = [ url(r'^$', views.BasketsView.as_view(), name='create'), url(r'^(?P[\w]+)/order/$', views.BasketOrderView.as_view(), name='retrieve_order'), -) +] -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^baskets/', include(BASKET_URLS, namespace='baskets')), -) +] diff --git a/lms/djangoapps/commerce/api/v1/urls.py b/lms/djangoapps/commerce/api/v1/urls.py index 90d149a5e2..e448701ea8 100644 --- a/lms/djangoapps/commerce/api/v1/urls.py +++ b/lms/djangoapps/commerce/api/v1/urls.py @@ -1,22 +1,19 @@ """ API v1 URLs. """ from django.conf import settings -from django.conf.urls import include, patterns, url +from django.conf.urls import include, url from commerce.api.v1 import views -COURSE_URLS = patterns( - '', +COURSE_URLS = [ url(r'^$', views.CourseListView.as_view(), name='list'), url(r'^{}/$'.format(settings.COURSE_ID_PATTERN), views.CourseRetrieveUpdateView.as_view(), name='retrieve_update'), -) +] -ORDER_URLS = patterns( - '', +ORDER_URLS = [ url(r'^(?P[-\w]+)/$', views.OrderView.as_view(), name='detail'), -) +] -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^courses/', include(COURSE_URLS, namespace='courses')), url(r'^orders/', include(ORDER_URLS, namespace='orders')), -) +] diff --git a/lms/djangoapps/commerce/urls.py b/lms/djangoapps/commerce/urls.py index 665a7f8c0c..b8c3774f82 100644 --- a/lms/djangoapps/commerce/urls.py +++ b/lms/djangoapps/commerce/urls.py @@ -1,15 +1,13 @@ """ Defines the URL routes for this app. """ -from django.conf.urls import patterns, url +from django.conf.urls import url from commerce import views -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^checkout/cancel/$', views.checkout_cancel, name='checkout_cancel'), url(r'^checkout/error/$', views.checkout_error, name='checkout_error'), url(r'^checkout/receipt/$', views.checkout_receipt, name='checkout_receipt'), url(r'^checkout/verification_status/$', views.user_verification_status, name='user_verification_status'), - -) +] diff --git a/lms/djangoapps/course_api/blocks/urls.py b/lms/djangoapps/course_api/blocks/urls.py index 7cadd939b5..7fb3ca83f9 100644 --- a/lms/djangoapps/course_api/blocks/urls.py +++ b/lms/djangoapps/course_api/blocks/urls.py @@ -2,12 +2,11 @@ Course Block API URLs """ from django.conf import settings -from django.conf.urls import patterns, url +from django.conf.urls import url from .views import BlocksInCourseView, BlocksView -urlpatterns = patterns( - '', +urlpatterns = [ # This endpoint requires the usage_key for the starting block. url( r'^v1/blocks/{}'.format(settings.USAGE_KEY_PATTERN), @@ -21,4 +20,4 @@ urlpatterns = patterns( BlocksInCourseView.as_view(), name="blocks_in_course" ), -) +] diff --git a/lms/djangoapps/course_api/urls.py b/lms/djangoapps/course_api/urls.py index 294d03be32..c25f4d1ab5 100644 --- a/lms/djangoapps/course_api/urls.py +++ b/lms/djangoapps/course_api/urls.py @@ -2,13 +2,12 @@ Course API URLs """ from django.conf import settings -from django.conf.urls import include, patterns, url +from django.conf.urls import include, url from .views import CourseDetailView, CourseListView -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^v1/courses/$', CourseListView.as_view(), name="course-list"), url(r'^v1/courses/{}'.format(settings.COURSE_KEY_PATTERN), CourseDetailView.as_view(), name="course-detail"), url(r'', include('course_api.blocks.urls')) -) +] diff --git a/lms/djangoapps/course_goals/urls.py b/lms/djangoapps/course_goals/urls.py index cb87b3db77..d00976b37a 100644 --- a/lms/djangoapps/course_goals/urls.py +++ b/lms/djangoapps/course_goals/urls.py @@ -1,7 +1,7 @@ """ Course Goals URLs """ -from django.conf.urls import include, patterns, url +from django.conf.urls import include, url from rest_framework import routers from .views import CourseGoalViewSet @@ -9,7 +9,6 @@ from .views import CourseGoalViewSet router = routers.DefaultRouter() router.register(r'course_goals', CourseGoalViewSet, base_name='course_goal') -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^v0/', include(router.urls, namespace='v0')), -) +] diff --git a/lms/djangoapps/course_structure_api/urls.py b/lms/djangoapps/course_structure_api/urls.py index c5b6f37a50..658e312240 100644 --- a/lms/djangoapps/course_structure_api/urls.py +++ b/lms/djangoapps/course_structure_api/urls.py @@ -3,9 +3,8 @@ Course Structure API URI specification. Patterns here should simply point to version-specific patterns. """ -from django.conf.urls import include, patterns, url +from django.conf.urls import include, url -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^v0/', include('course_structure_api.v0.urls', namespace='v0')) -) +] diff --git a/lms/djangoapps/course_structure_api/v0/urls.py b/lms/djangoapps/course_structure_api/v0/urls.py index 8bc0fb9a8f..3d2861297e 100644 --- a/lms/djangoapps/course_structure_api/v0/urls.py +++ b/lms/djangoapps/course_structure_api/v0/urls.py @@ -2,14 +2,13 @@ Courses Structure API v0 URI specification """ from django.conf import settings -from django.conf.urls import patterns, url +from django.conf.urls import url from course_structure_api.v0 import views COURSE_ID_PATTERN = settings.COURSE_ID_PATTERN -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^courses/$', views.CourseList.as_view(), name='list'), url(r'^courses/{}/$'.format(COURSE_ID_PATTERN), views.CourseDetail.as_view(), name='detail'), url(r'^course_structures/{}/$'.format(COURSE_ID_PATTERN), views.CourseStructure.as_view(), name='structure'), @@ -18,4 +17,4 @@ urlpatterns = patterns( views.CourseGradingPolicy.as_view(), name='grading_policy' ), -) +] diff --git a/lms/djangoapps/dashboard/sysadmin_urls.py b/lms/djangoapps/dashboard/sysadmin_urls.py index 489cf877cf..d90b490833 100644 --- a/lms/djangoapps/dashboard/sysadmin_urls.py +++ b/lms/djangoapps/dashboard/sysadmin_urls.py @@ -2,16 +2,15 @@ Urls for sysadmin dashboard feature """ -from django.conf.urls import patterns, url +from django.conf.urls import url from dashboard import sysadmin -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^$', sysadmin.Users.as_view(), name="sysadmin"), url(r'^courses/?$', sysadmin.Courses.as_view(), name="sysadmin_courses"), url(r'^staffing/?$', sysadmin.Staffing.as_view(), name="sysadmin_staffing"), url(r'^gitlogs/?$', sysadmin.GitLogs.as_view(), name="gitlogs"), url(r'^gitlogs/(?P.+)$', sysadmin.GitLogs.as_view(), name="gitlogs_detail"), -) +] diff --git a/lms/djangoapps/discussion/urls.py b/lms/djangoapps/discussion/urls.py index e1fa4de8f7..d6bf5fe749 100644 --- a/lms/djangoapps/discussion/urls.py +++ b/lms/djangoapps/discussion/urls.py @@ -1,21 +1,20 @@ """ Forum urls for the django_comment_client. """ -from django.conf.urls import patterns, url +from django.conf.urls import url -from .views import DiscussionBoardFragmentView +from discussion import views -urlpatterns = patterns( - 'discussion.views', - - url(r'users/(?P\w+)/followed$', 'followed_threads', name='followed_threads'), - url(r'users/(?P\w+)$', 'user_profile', name='user_profile'), - url(r'^(?P[\w\-.]+)/threads/(?P\w+)$', 'single_thread', name='single_thread'), - url(r'^(?P[\w\-.]+)/inline$', 'inline_discussion', name='inline_discussion'), +urlpatterns = [ + url(r'users/(?P\w+)/followed$', views.followed_threads, name='followed_threads'), + url(r'users/(?P\w+)$', views.user_profile, name='user_profile'), + url(r'^(?P[\w\-.]+)/threads/(?P\w+)$', views.single_thread, + name='single_thread'), + url(r'^(?P[\w\-.]+)/inline$', views.inline_discussion, name='inline_discussion'), url( r'discussion_board_fragment_view$', - DiscussionBoardFragmentView.as_view(), + views.DiscussionBoardFragmentView.as_view(), name='discussion_board_fragment_view' ), - url(r'', 'forum_form_discussion', name='forum_form_discussion'), -) + url(r'', views.forum_form_discussion, name='forum_form_discussion'), +] diff --git a/lms/djangoapps/discussion_api/urls.py b/lms/djangoapps/discussion_api/urls.py index 6edf3eab9f..4d884582ba 100644 --- a/lms/djangoapps/discussion_api/urls.py +++ b/lms/djangoapps/discussion_api/urls.py @@ -2,7 +2,7 @@ Discussion API URLs """ from django.conf import settings -from django.conf.urls import include, patterns, url +from django.conf.urls import include, url from rest_framework.routers import SimpleRouter from discussion_api.views import CommentViewSet, CourseTopicsView, CourseView, ThreadViewSet @@ -11,8 +11,7 @@ ROUTER = SimpleRouter() ROUTER.register("threads", ThreadViewSet, base_name="thread") ROUTER.register("comments", CommentViewSet, base_name="comment") -urlpatterns = patterns( - "discussion_api", +urlpatterns = [ url( r"^v1/courses/{}".format(settings.COURSE_ID_PATTERN), CourseView.as_view(), @@ -24,4 +23,4 @@ urlpatterns = patterns( name="course_topics" ), url("^v1/", include(ROUTER.urls)), -) +] diff --git a/lms/djangoapps/django_comment_client/base/urls.py b/lms/djangoapps/django_comment_client/base/urls.py index 0e26310c75..042288e8ab 100644 --- a/lms/djangoapps/django_comment_client/base/urls.py +++ b/lms/djangoapps/django_comment_client/base/urls.py @@ -1,36 +1,39 @@ """ Base urls for the django_comment_client. """ -from django.conf.urls import patterns, url +from django.conf.urls import url -urlpatterns = patterns( - 'django_comment_client.base.views', +from django_comment_client.base import views - url(r'upload$', 'upload', name='upload'), - url(r'threads/(?P[\w\-]+)/update$', 'update_thread', name='update_thread'), - url(r'threads/(?P[\w\-]+)/reply$', 'create_comment', name='create_comment'), - url(r'threads/(?P[\w\-]+)/delete', 'delete_thread', name='delete_thread'), - url(r'threads/(?P[\w\-]+)/upvote$', 'vote_for_thread', {'value': 'up'}, name='upvote_thread'), - url(r'threads/(?P[\w\-]+)/downvote$', 'vote_for_thread', {'value': 'down'}, name='downvote_thread'), - url(r'threads/(?P[\w\-]+)/flagAbuse$', 'flag_abuse_for_thread', name='flag_abuse_for_thread'), - url(r'threads/(?P[\w\-]+)/unFlagAbuse$', 'un_flag_abuse_for_thread', name='un_flag_abuse_for_thread'), - url(r'threads/(?P[\w\-]+)/unvote$', 'undo_vote_for_thread', name='undo_vote_for_thread'), - url(r'threads/(?P[\w\-]+)/pin$', 'pin_thread', name='pin_thread'), - url(r'threads/(?P[\w\-]+)/unpin$', 'un_pin_thread', name='un_pin_thread'), - url(r'threads/(?P[\w\-]+)/follow$', 'follow_thread', name='follow_thread'), - url(r'threads/(?P[\w\-]+)/unfollow$', 'unfollow_thread', name='unfollow_thread'), - url(r'threads/(?P[\w\-]+)/close$', 'openclose_thread', name='openclose_thread'), - url(r'comments/(?P[\w\-]+)/update$', 'update_comment', name='update_comment'), - url(r'comments/(?P[\w\-]+)/endorse$', 'endorse_comment', name='endorse_comment'), - url(r'comments/(?P[\w\-]+)/reply$', 'create_sub_comment', name='create_sub_comment'), - url(r'comments/(?P[\w\-]+)/delete$', 'delete_comment', name='delete_comment'), - url(r'comments/(?P[\w\-]+)/upvote$', 'vote_for_comment', {'value': 'up'}, name='upvote_comment'), - url(r'comments/(?P[\w\-]+)/downvote$', 'vote_for_comment', {'value': 'down'}, name='downvote_comment'), - url(r'comments/(?P[\w\-]+)/unvote$', 'undo_vote_for_comment', name='undo_vote_for_comment'), - url(r'comments/(?P[\w\-]+)/flagAbuse$', 'flag_abuse_for_comment', name='flag_abuse_for_comment'), - url(r'comments/(?P[\w\-]+)/unFlagAbuse$', 'un_flag_abuse_for_comment', name='un_flag_abuse_for_comment'), - url(r'^(?P[\w\-.]+)/threads/create$', 'create_thread', name='create_thread'), - url(r'^(?P[\w\-.]+)/follow$', 'follow_commentable', name='follow_commentable'), - url(r'^(?P[\w\-.]+)/unfollow$', 'unfollow_commentable', name='unfollow_commentable'), - url(r'users$', 'users', name='users'), -) +urlpatterns = [ + url(r'upload$', views.upload, name='upload'), + url(r'threads/(?P[\w\-]+)/update$', views.update_thread, name='update_thread'), + url(r'threads/(?P[\w\-]+)/reply$', views.create_comment, name='create_comment'), + url(r'threads/(?P[\w\-]+)/delete', views.delete_thread, name='delete_thread'), + url(r'threads/(?P[\w\-]+)/upvote$', views.vote_for_thread, {'value': 'up'}, name='upvote_thread'), + url(r'threads/(?P[\w\-]+)/downvote$', views.vote_for_thread, {'value': 'down'}, name='downvote_thread'), + url(r'threads/(?P[\w\-]+)/flagAbuse$', views.flag_abuse_for_thread, name='flag_abuse_for_thread'), + url(r'threads/(?P[\w\-]+)/unFlagAbuse$', views.un_flag_abuse_for_thread, + name='un_flag_abuse_for_thread'), + url(r'threads/(?P[\w\-]+)/unvote$', views.undo_vote_for_thread, name='undo_vote_for_thread'), + url(r'threads/(?P[\w\-]+)/pin$', views.pin_thread, name='pin_thread'), + url(r'threads/(?P[\w\-]+)/unpin$', views.un_pin_thread, name='un_pin_thread'), + url(r'threads/(?P[\w\-]+)/follow$', views.follow_thread, name='follow_thread'), + url(r'threads/(?P[\w\-]+)/unfollow$', views.unfollow_thread, name='unfollow_thread'), + url(r'threads/(?P[\w\-]+)/close$', views.openclose_thread, name='openclose_thread'), + url(r'comments/(?P[\w\-]+)/update$', views.update_comment, name='update_comment'), + url(r'comments/(?P[\w\-]+)/endorse$', views.endorse_comment, name='endorse_comment'), + url(r'comments/(?P[\w\-]+)/reply$', views.create_sub_comment, name='create_sub_comment'), + url(r'comments/(?P[\w\-]+)/delete$', views.delete_comment, name='delete_comment'), + url(r'comments/(?P[\w\-]+)/upvote$', views.vote_for_comment, {'value': 'up'}, name='upvote_comment'), + url(r'comments/(?P[\w\-]+)/downvote$', views.vote_for_comment, {'value': 'down'}, + name='downvote_comment'), + url(r'comments/(?P[\w\-]+)/unvote$', views.undo_vote_for_comment, name='undo_vote_for_comment'), + url(r'comments/(?P[\w\-]+)/flagAbuse$', views.flag_abuse_for_comment, name='flag_abuse_for_comment'), + url(r'comments/(?P[\w\-]+)/unFlagAbuse$', views.un_flag_abuse_for_comment, + name='un_flag_abuse_for_comment'), + url(r'^(?P[\w\-.]+)/threads/create$', views.create_thread, name='create_thread'), + url(r'^(?P[\w\-.]+)/follow$', views.follow_commentable, name='follow_commentable'), + url(r'^(?P[\w\-.]+)/unfollow$', views.unfollow_commentable, name='unfollow_commentable'), + url(r'users$', views.users, name='users'), +] diff --git a/lms/djangoapps/django_comment_client/urls.py b/lms/djangoapps/django_comment_client/urls.py index ddebe62260..71326ba227 100644 --- a/lms/djangoapps/django_comment_client/urls.py +++ b/lms/djangoapps/django_comment_client/urls.py @@ -1,10 +1,8 @@ """ Urls for the django_comment_client. """ -from django.conf.urls import include, patterns, url - -urlpatterns = patterns( - '', +from django.conf.urls import include, url +urlpatterns = [ url(r'', include('django_comment_client.base.urls')), -) +] diff --git a/lms/djangoapps/edxnotes/urls.py b/lms/djangoapps/edxnotes/urls.py index 544d42c711..95c81ade09 100644 --- a/lms/djangoapps/edxnotes/urls.py +++ b/lms/djangoapps/edxnotes/urls.py @@ -1,13 +1,14 @@ """ URLs for EdxNotes. """ -from django.conf.urls import patterns, url +from django.conf.urls import url + +from edxnotes import views # Additionally, we include login URLs for the browseable API. -urlpatterns = patterns( - "edxnotes.views", - url(r"^/$", "edxnotes", name="edxnotes"), - url(r"^/notes/$", "notes", name="notes"), - url(r"^/token/$", "get_token", name="get_token"), - url(r"^/visibility/$", "edxnotes_visibility", name="edxnotes_visibility"), -) +urlpatterns = [ + url(r"^/$", views.edxnotes, name="edxnotes"), + url(r"^/notes/$", views.notes, name="notes"), + url(r"^/token/$", views.get_token, name="get_token"), + url(r"^/visibility/$", views.edxnotes_visibility, name="edxnotes_visibility"), +]