Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
333e1ccb
Unverified
Commit
333e1ccb
authored
Nov 07, 2017
by
Brian Mesick
Committed by
GitHub
Nov 07, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16433 from edx/bmedx/django111_urls_common
common urls cleanup for Django 1.11
parents
8d71b98a
ffc2a0eb
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
65 additions
and
83 deletions
+65
-83
cms/urls_dev.py
+5
-3
common/djangoapps/course_modes/urls.py
+7
-7
common/djangoapps/enrollment/urls.py
+11
-21
common/djangoapps/student/urls.py
+25
-32
common/djangoapps/third_party_auth/api/urls.py
+3
-4
common/djangoapps/third_party_auth/urls.py
+3
-4
common/djangoapps/track/urls.py
+11
-12
No files found.
cms/urls_dev.py
View file @
333e1ccb
...
...
@@ -5,6 +5,8 @@ development mode; otherwise, it is ignored.
"""
from
django.conf.urls
import
url
urlpatterns
=
(
url
(
r'^dev_mode$'
,
'contentstore.views.dev.dev_mode'
,
name
=
'dev_mode'
),
)
from
contentstore.views.dev
import
dev_mode
urlpatterns
=
[
url
(
r'^dev_mode$'
,
dev_mode
,
name
=
'dev_mode'
),
]
common/djangoapps/course_modes/urls.py
View file @
333e1ccb
from
django.conf
import
settings
from
django.conf.urls
import
patterns
,
url
from
django.conf.urls
import
url
from
course_modes
import
views
urlpatterns
=
patterns
(
''
,
# pylint seems to dislike as_view() calls because it's a `classonlymethod` instead of `classmethod`, so we disable the warning
urlpatterns
=
[
url
(
r'^choose/{}/$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
views
.
ChooseModeView
.
as_view
(),
name
=
'course_modes_choose'
),
)
]
# Enable verified mode creation
if
settings
.
FEATURES
.
get
(
'MODE_CREATION_FOR_TESTING'
):
urlpatterns
+=
(
url
(
r'^create_mode/{}/$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
'course_modes.views.create_mode'
,
name
=
'create_mode'
),
urlpatterns
.
append
(
url
(
r'^create_mode/{}/$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
views
.
create_mode
,
name
=
'create_mode'
),
)
common/djangoapps/enrollment/urls.py
View file @
333e1ccb
...
...
@@ -3,28 +3,18 @@ URLs for the Enrollment API
"""
from
django.conf
import
settings
from
django.conf.urls
import
patterns
,
url
from
django.conf.urls
import
url
from
.views
import
EnrollmentCourseDetailView
,
EnrollmentListView
,
EnrollmentView
urlpatterns
=
patterns
(
'enrollment.views'
,
url
(
r'^enrollment/{username},{course_key}$'
.
format
(
username
=
settings
.
USERNAME_PATTERN
,
course_key
=
settings
.
COURSE_ID_PATTERN
),
EnrollmentView
.
as_view
(),
name
=
'courseenrollment'
),
url
(
r'^enrollment/{course_key}$'
.
format
(
course_key
=
settings
.
COURSE_ID_PATTERN
),
EnrollmentView
.
as_view
(),
name
=
'courseenrollment'
),
urlpatterns
=
[
url
(
r'^enrollment/{username},{course_key}$'
.
format
(
username
=
settings
.
USERNAME_PATTERN
,
course_key
=
settings
.
COURSE_ID_PATTERN
),
EnrollmentView
.
as_view
(),
name
=
'courseenrollment'
),
url
(
r'^enrollment/{course_key}$'
.
format
(
course_key
=
settings
.
COURSE_ID_PATTERN
),
EnrollmentView
.
as_view
(),
name
=
'courseenrollment'
),
url
(
r'^enrollment$'
,
EnrollmentListView
.
as_view
(),
name
=
'courseenrollments'
),
url
(
r'^course/{course_key}$'
.
format
(
course_key
=
settings
.
COURSE_ID_PATTERN
),
EnrollmentCourseDetailView
.
as_view
(),
name
=
'courseenrollmentdetails'
),
)
url
(
r'^course/{course_key}$'
.
format
(
course_key
=
settings
.
COURSE_ID_PATTERN
),
EnrollmentCourseDetailView
.
as_view
(),
name
=
'courseenrollmentdetails'
),
]
common/djangoapps/student/urls.py
View file @
333e1ccb
...
...
@@ -3,65 +3,58 @@ URLs for student app
"""
from
django.conf
import
settings
from
django.conf.urls
import
patterns
,
url
from
django.conf.urls
import
url
from
django.contrib.auth.views
import
password_reset_complete
from
student.views
import
LogoutView
import
student.views
urlpatterns
=
(
'student.views'
,
url
(
r'^logout$'
,
LogoutView
.
as_view
(),
name
=
'logout'
),
urlpatterns
=
[
url
(
r'^logout$'
,
student
.
views
.
LogoutView
.
as_view
(),
name
=
'logout'
),
# TODO: standardize login
# login endpoint used by cms.
url
(
r'^login_post$'
,
'login_user'
,
name
=
'login_post'
),
url
(
r'^login_post$'
,
student
.
views
.
login_user
,
name
=
'login_post'
),
# login endpoints used by lms.
url
(
r'^login_ajax$'
,
'login_user'
,
name
=
"login"
),
url
(
r'^login_ajax/(?P<error>[^/]*)$'
,
'login_user'
),
url
(
r'^login_ajax$'
,
student
.
views
.
login_user
,
name
=
"login"
),
url
(
r'^login_ajax/(?P<error>[^/]*)$'
,
student
.
views
.
login_user
),
url
(
r'^email_confirm/(?P<key>[^/]*)$'
,
'confirm_email_change'
),
url
(
r'^email_confirm/(?P<key>[^/]*)$'
,
student
.
views
.
confirm_email_change
),
url
(
r'^create_account$'
,
'create_account'
,
name
=
'create_account'
),
url
(
r'^activate/(?P<key>[^/]*)$'
,
'activate_account'
,
name
=
"activate"
),
url
(
r'^create_account$'
,
student
.
views
.
create_account
,
name
=
'create_account'
),
url
(
r'^activate/(?P<key>[^/]*)$'
,
student
.
views
.
activate_account
,
name
=
"activate"
),
url
(
r'^accounts/disable_account_ajax$'
,
'disable_account_ajax'
,
name
=
"disable_account_ajax"
),
url
(
r'^accounts/manage_user_standing'
,
'manage_user_standing'
,
name
=
'manage_user_standing'
),
url
(
r'^accounts/disable_account_ajax$'
,
student
.
views
.
disable_account_ajax
,
name
=
"disable_account_ajax"
),
url
(
r'^accounts/manage_user_standing'
,
student
.
views
.
manage_user_standing
,
name
=
'manage_user_standing'
),
url
(
r'^change_setting$'
,
'change_setting'
,
name
=
'change_setting'
),
url
(
r'^change_email_settings$'
,
'change_email_settings'
,
name
=
'change_email_settings'
),
url
(
r'^change_setting$'
,
student
.
views
.
change_setting
,
name
=
'change_setting'
),
url
(
r'^change_email_settings$'
,
student
.
views
.
change_email_settings
,
name
=
'change_email_settings'
),
# password reset in student.views (see below for password reset django views)
url
(
r'^password_reset/$'
,
'password_reset'
,
name
=
'password_reset'
),
url
(
r'^password_reset/$'
,
student
.
views
.
password_reset
,
name
=
'password_reset'
),
url
(
r'^password_reset_confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$'
,
'password_reset_confirm_wrapper'
,
student
.
views
.
password_reset_confirm_wrapper
,
name
=
'password_reset_confirm'
,
),
url
(
r'^course_run/{}/refund_status$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
'course_run_refund_status'
,
student
.
views
.
course_run_refund_status
,
name
=
"course_run_refund_status"
),
)
]
# enable automatic login
if
settings
.
FEATURES
.
get
(
'AUTOMATIC_AUTH_FOR_TESTING'
):
urlpatterns
+=
(
url
(
r'^auto_auth$'
,
'auto_auth'
),
)
# add all student.views url patterns
urlpatterns
=
patterns
(
*
urlpatterns
)
urlpatterns
+=
[
url
(
r'^auto_auth$'
,
student
.
views
.
auto_auth
),
]
# password reset django views (see above for password reset student.views)
urlpatterns
+=
patterns
(
'django.contrib.auth.views'
,
urlpatterns
+=
[
# TODO: Replace with Mako-ized views
url
(
r'^password_reset_complete/$'
,
'password_reset_complete'
,
password_reset_complete
,
name
=
'password_reset_complete'
,
),
)
]
common/djangoapps/third_party_auth/api/urls.py
View file @
333e1ccb
""" URL configuration for the third party auth API """
from
django.conf
import
settings
from
django.conf.urls
import
patterns
,
url
from
django.conf.urls
import
url
from
.views
import
UserMappingView
,
UserView
PROVIDER_PATTERN
=
r'(?P<provider_id>[\w.+-]+)(?:\:(?P<idp_slug>[\w.+-]+))?'
urlpatterns
=
patterns
(
''
,
urlpatterns
=
[
url
(
r'^v0/users/{username_pattern}$'
.
format
(
username_pattern
=
settings
.
USERNAME_PATTERN
),
UserView
.
as_view
(),
...
...
@@ -20,4 +19,4 @@ urlpatterns = patterns(
UserMappingView
.
as_view
(),
name
=
'third_party_auth_user_mapping_api'
,
),
)
]
common/djangoapps/third_party_auth/urls.py
View file @
333e1ccb
"""Url configuration for the auth module."""
from
django.conf.urls
import
include
,
patterns
,
url
from
django.conf.urls
import
include
,
url
from
.views
import
inactive_user_view
,
lti_login_and_complete_view
,
post_to_custom_auth_form
,
saml_metadata_view
urlpatterns
=
patterns
(
''
,
urlpatterns
=
[
url
(
r'^auth/inactive'
,
inactive_user_view
,
name
=
"third_party_inactive_redirect"
),
url
(
r'^auth/custom_auth_entry'
,
post_to_custom_auth_form
,
name
=
'tpa_post_to_custom_auth_form'
),
url
(
r'^auth/saml/metadata.xml'
,
saml_metadata_view
),
url
(
r'^auth/login/(?P<backend>lti)/$'
,
lti_login_and_complete_view
),
url
(
r'^auth/'
,
include
(
'social_django.urls'
,
namespace
=
'social'
)),
)
]
common/djangoapps/track/urls.py
View file @
333e1ccb
...
...
@@ -3,19 +3,18 @@ URLs for track app
"""
from
django.conf
import
settings
from
django.conf.urls
import
patterns
,
url
from
django.conf.urls
import
url
urlpatterns
=
(
'track.views'
,
import
track.views
import
track.views.segmentio
url
(
r'^event$'
,
'user_track'
),
url
(
r'^segmentio/event$'
,
'segmentio.segmentio_event'
),
)
urlpatterns
=
[
url
(
r'^event$'
,
track
.
views
.
user_track
),
url
(
r'^segmentio/event$'
,
track
.
views
.
segmentio
.
segmentio_event
),
]
if
settings
.
FEATURES
.
get
(
'ENABLE_SQL_TRACKING_LOGS'
):
urlpatterns
+=
(
url
(
r'^event_logs$'
,
'view_tracking_log'
),
url
(
r'^event_logs/(?P<args>.+)$'
,
'view_tracking_log'
),
)
urlpatterns
=
patterns
(
*
urlpatterns
)
urlpatterns
+=
[
url
(
r'^event_logs$'
,
track
.
views
.
view_tracking_log
),
url
(
r'^event_logs/(?P<args>.+)$'
,
track
.
views
.
view_tracking_log
),
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment