urls.py 22.2 KB
Newer Older
Piotr Mitros committed
1
from django.conf import settings
2
from django.conf.urls import patterns, include, url
Piotr Mitros committed
3
from django.contrib import admin
4
from django.conf.urls.static import static
5
from django.views.generic import RedirectView
6
import django.contrib.auth.views
Piotr Mitros committed
7 8

# Uncomment the next two lines to enable the admin:
9 10 11
if settings.DEBUG:
    from django.contrib import admin
    admin.autodiscover()
Piotr Mitros committed
12

Piotr Mitros committed
13
urlpatterns = ('',
14 15 16
    # certificate view

    url(r'^update_certificate$', 'certificates.views.update_certificate'),
Calen Pennington committed
17
    url(r'^$', 'branding.views.index', name="root"),   # Main marketing page, or redirect to courseware
18
    url(r'^dashboard$', 'student.views.dashboard', name="dashboard"),
19

20
    url(r'^admin_dashboard$', 'dashboard.views.dashboard'),
21

22 23 24 25
    # Adding to allow debugging issues when prod is mysteriously different from staging
    # (specifically missing get parameters in certain cases)
    url(r'^debug_request$', 'util.views.debug_request'),

26
    url(r'^change_email$', 'student.views.change_email_request', name="change_email"),
27
    url(r'^email_confirm/(?P<key>[^/]*)$', 'student.views.confirm_email_change'),
28
    url(r'^change_name$', 'student.views.change_name_request', name="change_name"),
29 30 31
    url(r'^accept_name_change$', 'student.views.accept_name_change'),
    url(r'^reject_name_change$', 'student.views.reject_name_change'),
    url(r'^pending_name_changes$', 'student.views.pending_name_changes'),
32

33 34 35 36 37
    url(r'^testcenter/login$', 'student.views.test_center_login'),

    # url(r'^testcenter/login$', 'student.test_center_views.login'),
    # url(r'^testcenter/logout$', 'student.test_center_views.logout'),

38
    url(r'^event$', 'track.views.user_track'),
Calen Pennington committed
39
    url(r'^t/(?P<template>[^/]*)$', 'static_template_view.views.index'),   # TODO: Is this used anymore? What is STATIC_GRAB?
40

41 42
    url(r'^accounts/login$', 'student.views.accounts_login', name="accounts_login"),

43
    url(r'^login$', 'student.views.login_user', name="login"),
44
    url(r'^login/(?P<error>[^/]*)$', 'student.views.login_user'),
45
    url(r'^logout$', 'student.views.logout_user', name='logout'),
46
    url(r'^create_account$', 'student.views.create_account'),
47 48
    url(r'^activate/(?P<key>[^/]*)$', 'student.views.activate_account', name="activate"),

49 50
    url(r'^begin_exam_registration/(?P<course_id>[^/]+/[^/]+/[^/]+)$', 'student.views.begin_exam_registration', name="begin_exam_registration"),
    url(r'^create_exam_registration$', 'student.views.create_exam_registration'),
51

52
    url(r'^password_reset/$', 'student.views.password_reset', name='password_reset'),
53 54
    ## Obsolete Django views for password resets
    ## TODO: Replace with Mako-ized views
55 56 57 58 59 60
    url(r'^password_change/$', django.contrib.auth.views.password_change,
        name='auth_password_change'),
    url(r'^password_change_done/$', django.contrib.auth.views.password_change_done,
        name='auth_password_change_done'),
    url(r'^password_reset_confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
        django.contrib.auth.views.password_reset_confirm,
Piotr Mitros committed
61
        name='auth_password_reset_confirm'),
62
    url(r'^password_reset_complete/$', django.contrib.auth.views.password_reset_complete,
Piotr Mitros committed
63
        name='auth_password_reset_complete'),
64
    url(r'^password_reset_done/$', django.contrib.auth.views.password_reset_done,
Piotr Mitros committed
65
        name='auth_password_reset_done'),
66

67
    url(r'^heartbeat$', include('heartbeat.urls')),
68

69 70 71 72 73 74
    url(r'^university_profile/UTx$', 'courseware.views.static_university_profile',
        name="static_university_profile", kwargs={'org_id': 'UTx'}),
    url(r'^university_profile/WellesleyX$', 'courseware.views.static_university_profile',
        name="static_university_profile", kwargs={'org_id': 'WellesleyX'}),
    url(r'^university_profile/GeorgetownX$', 'courseware.views.static_university_profile',
        name="static_university_profile", kwargs={'org_id': 'GeorgetownX'}),
75 76 77

    # Dan accidentally sent out a press release with lower case urls for McGill, Toronto,
    # Rice, ANU, Delft, and EPFL.  Hence the redirects.
78 79
    url(r'^university_profile/McGillX$', 'courseware.views.static_university_profile',
        name="static_university_profile", kwargs={'org_id': 'McGillX'}),
80 81 82
    url(r'^university_profile/mcgillx$',
        RedirectView.as_view(url='/university_profile/McGillX')),

83 84
    url(r'^university_profile/TorontoX$', 'courseware.views.static_university_profile',
        name="static_university_profile", kwargs={'org_id': 'TorontoX'}),
85 86 87
    url(r'^university_profile/torontox$',
        RedirectView.as_view(url='/university_profile/TorontoX')),

88 89
    url(r'^university_profile/RiceX$', 'courseware.views.static_university_profile',
        name="static_university_profile", kwargs={'org_id': 'RiceX'}),
90 91 92
    url(r'^university_profile/ricex$',
        RedirectView.as_view(url='/university_profile/RiceX')),

93 94
    url(r'^university_profile/ANUx$', 'courseware.views.static_university_profile',
        name="static_university_profile", kwargs={'org_id': 'ANUx'}),
95 96 97
    url(r'^university_profile/anux$',
        RedirectView.as_view(url='/university_profile/ANUx')),

98 99
    url(r'^university_profile/DelftX$', 'courseware.views.static_university_profile',
        name="static_university_profile", kwargs={'org_id': 'DelftX'}),
100 101 102
    url(r'^university_profile/delftx$',
        RedirectView.as_view(url='/university_profile/DelftX')),

103 104
    url(r'^university_profile/EPFLx$', 'courseware.views.static_university_profile',
        name="static_university_profile", kwargs={'org_id': 'EPFLx'}),
105 106
    url(r'^university_profile/epflx$',
        RedirectView.as_view(url='/university_profile/EPFLx')),
107 108 109

    url(r'^university_profile/(?P<org_id>[^/]+)$', 'courseware.views.university_profile',
        name="university_profile"),
110

111
    #Semi-static views (these need to be rendered and have the login bar, but don't change)
112
    url(r'^404$', 'static_template_view.views.render',
113
        {'template': '404.html'}, name="404"),
114
    url(r'^about$', 'static_template_view.views.render',
115
        {'template': 'about.html'}, name="about_edx"),
116
    url(r'^jobs$', 'static_template_view.views.render',
117
        {'template': 'jobs.html'}, name="jobs"),
118
    url(r'^contact$', 'static_template_view.views.render',
119
        {'template': 'contact.html'}, name="contact"),
120
    url(r'^press$', 'student.views.press', name="press"),
121 122
    url(r'^media-kit$', 'static_template_view.views.render',
        {'template': 'media-kit.html'}, name="media-kit"),
123
    url(r'^faq$', 'static_template_view.views.render',
124
        {'template': 'faq.html'}, name="faq_edx"),
125
    url(r'^help$', 'static_template_view.views.render',
126
        {'template': 'help.html'}, name="help_edx"),
127

128
    url(r'^tos$', 'static_template_view.views.render',
129
        {'template': 'tos.html'}, name="tos"),
130
    url(r'^privacy$', 'static_template_view.views.render',
131
        {'template': 'privacy.html'}, name="privacy_edx"),
132
    # TODO: (bridger) The copyright has been removed until it is updated for edX
133
    # url(r'^copyright$', 'static_template_view.views.render',
134
    #     {'template': 'copyright.html'}, name="copyright"),
135
    url(r'^honor$', 'static_template_view.views.render',
136
        {'template': 'honor.html'}, name="honor"),
137 138 139

    #Press releases
    url(r'^press/mit-and-harvard-announce-edx$', 'static_template_view.views.render',
140
        {'template': 'press_releases/MIT_and_Harvard_announce_edX.html'}, name="press/mit-and-harvard-announce-edx"),
141
    url(r'^press/uc-berkeley-joins-edx$', 'static_template_view.views.render',
142
        {'template': 'press_releases/UC_Berkeley_joins_edX.html'}, name="press/uc-berkeley-joins-edx"),
143 144
    url(r'^press/edX-announces-proctored-exam-testing$', 'static_template_view.views.render',
        {'template': 'press_releases/edX_announces_proctored_exam_testing.html'}, name="press/edX-announces-proctored-exam-testing"),
145 146
    url(r'^press/elsevier-collaborates-with-edx$', 'static_template_view.views.render',
        {'template': 'press_releases/Elsevier_collaborates_with_edX.html'}, name="press/elsevier-collaborates-with-edx"),
147 148
    url(r'^press/ut-joins-edx$', 'static_template_view.views.render',
        {'template': 'press_releases/UT_joins_edX.html'}, name="press/ut-joins-edx"),
149 150
    url(r'^press/cengage-to-provide-book-content$', 'static_template_view.views.render',
        {'template': 'press_releases/Cengage_to_provide_book_content.html'}, name="press/cengage-to-provide-book-content"),
151 152
    url(r'^press/gates-foundation-announcement$', 'static_template_view.views.render',
        {'template': 'press_releases/Gates_Foundation_announcement.html'}, name="press/gates-foundation-announcement"),
153 154
    url(r'^press/wellesley-college-joins-edx$', 'static_template_view.views.render',
        {'template': 'press_releases/Wellesley_College_joins_edX.html'}, name="press/wellesley-college-joins-edx"),
155 156 157
    url(r'^press/georgetown-joins-edx$', 'static_template_view.views.render',
        {'template': 'press_releases/Georgetown_joins_edX.html'}, name="press/georgetown-joins-edx"),
    url(r'^press/spring-courses$', 'static_template_view.views.render',
Victor Shnayder committed
158 159
        {'template': 'press_releases/Spring_2013_course_announcements.html'},
        name="press/spring-courses"),
160
    url(r'^press/lewin-course-announcement$', 'static_template_view.views.render',
Victor Shnayder committed
161 162 163 164 165
        {'template': 'press_releases/Lewin_course_announcement.html'},
        name="press/lewin-course-announcement"),
    url(r'^press/bostonx-announcement$', 'static_template_view.views.render',
        {'template': 'press_releases/bostonx_announcement.html'},
        name="press/bostonx-announcement"),
Victor Shnayder committed
166 167 168
    url(r'^press/eric-lander-secret-of-life$', 'static_template_view.views.render',
        {'template': 'press_releases/eric_lander_secret_of_life.html'},
        name="press/eric-lander-secret-of-life"),
169 170 171
    url(r'^press/edx-expands-internationally$', 'static_template_view.views.render',
        {'template': 'press_releases/edx_expands_internationally.html'},
        name="press/edx-expands-internationally"),
Victor Shnayder committed
172

173

174
    # Should this always update to point to the latest press release?
Victor Shnayder committed
175
    (r'^pressrelease$', 'django.views.generic.simple.redirect_to',
176
     {'url': '/press/edx-expands-internationally'}),
177 178


Bridger Maxwell committed
179
    (r'^favicon\.ico$', 'django.views.generic.simple.redirect_to', {'url': '/static/images/favicon.ico'}),
180

181 182 183
    # TODO: These urls no longer work. They need to be updated before they are re-enabled
    # url(r'^send_feedback$', 'util.views.send_feedback'),
    # url(r'^reactivate/(?P<key>[^/]*)$', 'student.views.reactivation_email'),
Piotr Mitros committed
184 185
)

186
if settings.PERFSTATS:
Calen Pennington committed
187
    urlpatterns += (url(r'^reprofile$', 'perfstats.views.end_profile'),)
188

189

190

191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
# Multicourse wiki (Note: wiki urls must be above the courseware ones because of
# the custom tab catch-all)
if settings.WIKI_ENABLED:
    from wiki.urls import get_pattern as wiki_pattern
    from django_notify.urls import get_pattern as notify_pattern

    # Note that some of these urls are repeated in course_wiki.course_nav. Make sure to update
    # them together.
    urlpatterns += (
        # First we include views from course_wiki that we use to override the default views.
        # They come first in the urlpatterns so they get resolved first
        url('^wiki/create-root/$', 'course_wiki.views.root_create', name='root_create'),


        url(r'^wiki/', include(wiki_pattern())),
        url(r'^notify/', include(notify_pattern())),

        # These urls are for viewing the wiki in the context of a course. They should
        # never be returned by a reverse() so they come after the other url patterns
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/course_wiki/?$',
            'course_wiki.views.course_wiki_redirect', name="course_wiki"),
        url(r'^courses/(?:[^/]+/[^/]+/[^/]+)/wiki/', include(wiki_pattern())),
    )

215

Piotr Mitros committed
216
if settings.COURSEWARE_ENABLED:
217
    urlpatterns += (
218
        # Hook django-masquerade, allowing staff to view site as other users
Piotr Mitros committed
219
        url(r'^masquerade/', include('masquerade.urls')),
220

221 222
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/jump_to/(?P<location>.*)$',
            'courseware.views.jump_to', name="jump_to"),
223
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/modx/(?P<location>.*?)/(?P<dispatch>[^/]*)$',
224 225
            'courseware.module_render.modx_dispatch',
            name='modx_dispatch'),
226 227 228 229 230 231

        # TODO (vshnayder): This is a hack.  It creates a direct connection from
        # the LMS to capa functionality, and really wants to go through the
        # input types system so that previews can be context-specific.
        # Unfortunately, we don't have time to think through the right way to do
        # that (and implement it), and it's not a terrible thing to provide a
232
        # generic chemical-equation rendering service.
233 234 235
        url(r'^preview/chemcalc', 'courseware.module_render.preview_chemcalc',
            name='preview_chemcalc'),

236 237 238 239 240 241 242 243
        # Software Licenses

        # TODO: for now, this is the endpoint of an ajax replay
        # service that retrieve and assigns license numbers for
        # software assigned to a course. The numbers have to be loaded
        # into the database.
        url(r'^software-licenses$', 'licenses.views.user_software_license', name="user_software_license"),

244 245 246
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/xqueue/(?P<userid>[^/]*)/(?P<id>.*?)/(?P<dispatch>[^/]*)$',
            'courseware.module_render.xqueue_callback',
            name='xqueue_callback'),
247 248
        url(r'^change_setting$', 'student.views.change_setting',
            name='change_setting'),
249

250
        # TODO: These views need to be updated before they work
251
        url(r'^calculate$', 'util.views.calculate'),
252 253 254
        # TODO: We should probably remove the circuit package. I believe it was only used in the old way of saving wiki circuits for the wiki
        # url(r'^edit_circuit/(?P<circuit>[^/]*)$', 'circuit.views.edit_circuit'),
        # url(r'^save_circuit/(?P<circuit>[^/]*)$', 'circuit.views.save_circuit'),
255

256
        url(r'^courses/?$', 'branding.views.courses', name="courses"),
257
        url(r'^change_enrollment$',
258
            'student.views.change_enrollment_view', name="change_enrollment"),
259

260
        #About the course
261
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/about$',
262
            'courseware.views.course_about', name="about_course"),
263

264
        #Inside the course
265 266
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/$',
            'courseware.views.course_info', name="course_root"),
267
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/info$',
268
            'courseware.views.course_info', name="info"),
269
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/syllabus$',
Calen Pennington committed
270
            'courseware.views.syllabus', name="syllabus"),   # TODO arjun remove when custom tabs in place, see courseware/courses.py
271
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/book/(?P<book_index>[^/]*)/$',
272
            'staticbook.views.index', name="book"),
273
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/book/(?P<book_index>[^/]*)/(?P<page>[^/]*)$',
Bridger Maxwell committed
274
            'staticbook.views.index'),
275
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/book-shifted/(?P<page>[^/]*)$',
Bridger Maxwell committed
276
            'staticbook.views.index_shifted'),
277
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/courseware/?$',
278
            'courseware.views.index', name="courseware"),
279 280
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/courseware/(?P<chapter>[^/]*)/$',
            'courseware.views.index', name="courseware_chapter"),
281
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/courseware/(?P<chapter>[^/]*)/(?P<section>[^/]*)/$',
282
            'courseware.views.index', name="courseware_section"),
283 284
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/courseware/(?P<chapter>[^/]*)/(?P<section>[^/]*)/(?P<position>[^/]*)/?$',
            'courseware.views.index', name="courseware_position"),
285 286
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/progress$',
            'courseware.views.progress', name="progress"),
287
        # Takes optional student_id for instructor use--shows profile as that student sees it.
288 289
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/progress/(?P<student_id>[^/]*)/$',
            'courseware.views.progress', name="student_progress"),
290

291
        # For the instructor
292
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/instructor$',
293
            'instructor.views.instructor_dashboard', name="instructor_dashboard"),
294

295
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/gradebook$',
296
            'instructor.views.gradebook', name='gradebook'),
297
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/grade_summary$',
298
            'instructor.views.grade_summary', name='grade_summary'),
299
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/enroll_students$',
300
            'instructor.views.enroll_students', name='enroll_students'),
301
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/staff_grading$',
302
            'open_ended_grading.views.staff_grading', name='staff_grading'),
303
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/staff_grading/get_next$',
304
            'open_ended_grading.staff_grading_service.get_next', name='staff_grading_get_next'),
305
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/staff_grading/save_grade$',
306
            'open_ended_grading.staff_grading_service.save_grade', name='staff_grading_save_grade'),
307
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/staff_grading/save_grade$',
308
            'open_ended_grading.staff_grading_service.save_grade', name='staff_grading_save_grade'),
309
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/staff_grading/get_problem_list$',
310
            'open_ended_grading.staff_grading_service.get_problem_list', name='staff_grading_get_problem_list'),
311

312 313 314
        # Open Ended problem list
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/open_ended_problems$',
            'open_ended_grading.views.student_problem_list', name='open_ended_problems'),
Victor Shnayder committed
315

316 317 318
        # Open Ended flagged problem list
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/open_ended_flagged_problems$',
            'open_ended_grading.views.flagged_problem_list', name='open_ended_flagged_problems'),
319
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/open_ended_flagged_problems/take_action_on_flags$',
320
            'open_ended_grading.views.take_action_on_flags', name='open_ended_flagged_problems_take_action'),
Calen Pennington committed
321

322
		# Cohorts management
323 324 325 326 327 328 329 330 331 332 333
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/cohorts$',
            'course_groups.views.list_cohorts', name="cohorts"),
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/cohorts/add$',
            'course_groups.views.add_cohort',
            name="add_cohort"),
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/cohorts/(?P<cohort_id>[0-9]+)$',
            'course_groups.views.users_in_cohort',
            name="list_cohort"),
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/cohorts/(?P<cohort_id>[0-9]+)/add$',
            'course_groups.views.add_users_to_cohort',
            name="add_to_cohort"),
334 335 336
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/cohorts/(?P<cohort_id>[0-9]+)/delete$',
            'course_groups.views.remove_user_from_cohort',
            name="remove_from_cohort"),
337 338 339 340
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/cohorts/debug$',
            'course_groups.views.debug_cohort_mgmt',
            name="debug_cohort_mgmt"),

341 342 343
        # Open Ended Notifications
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/open_ended_notifications$',
            'open_ended_grading.views.combined_notifications', name='open_ended_notifications'),
344 345 346

        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/peer_grading$',
            'open_ended_grading.views.peer_grading', name='peer_grading'),
347
    )
348

349
    # discussion forums live within courseware, so courseware must be enabled first
Rocky Duan committed
350
    if settings.MITX_FEATURES.get('ENABLE_DISCUSSION_SERVICE'):
351 352

        urlpatterns += (
353
            url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/news$',
354 355 356 357
                'courseware.views.news', name="news"),
            url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/discussion/',
                include('django_comment_client.urls'))
            )
358 359
    urlpatterns += (
        # This MUST be the last view in the courseware--it's a catch-all for custom tabs.
360
        url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/(?P<tab_slug>[^/]+)/$',
361 362
        'courseware.views.static_tab', name="static_tab"),
        )
363

364
if settings.ENABLE_JASMINE:
365 366
    urlpatterns += (url(r'^_jasmine/', include('django_jasmine.urls')),)

367
if settings.DEBUG:
368
    ## Jasmine and admin
369
    urlpatterns += (url(r'^admin/', include(admin.site.urls)),)
370

ichuang committed
371 372 373
if settings.MITX_FEATURES.get('AUTH_USE_OPENID'):
    urlpatterns += (
        url(r'^openid/login/$', 'django_openid_auth.views.login_begin', name='openid-login'),
374
        url(r'^openid/complete/$', 'external_auth.views.openid_login_complete', name='openid-complete'),
ichuang committed
375
        url(r'^openid/logo.gif$', 'django_openid_auth.views.logo', name='openid-logo'),
376 377 378 379
    )

if settings.MITX_FEATURES.get('AUTH_USE_OPENID_PROVIDER'):
    urlpatterns += (
380
        url(r'^openid/provider/login/$', 'external_auth.views.provider_login', name='openid-provider-login'),
381
        url(r'^openid/provider/login/(?:.+)$', 'external_auth.views.provider_identity', name='openid-provider-login-identity'),
382 383
        url(r'^openid/provider/identity/$', 'external_auth.views.provider_identity', name='openid-provider-identity'),
        url(r'^openid/provider/xrds/$', 'external_auth.views.provider_xrds', name='openid-provider-xrds')
384
    )
ichuang committed
385

386 387 388 389
if settings.MITX_FEATURES.get('ENABLE_LMS_MIGRATION'):
    urlpatterns += (
        url(r'^migrate/modules$', 'lms_migration.migrate.manage_modulestores'),
        url(r'^migrate/reload/(?P<reload_dir>[^/]+)$', 'lms_migration.migrate.manage_modulestores'),
390
        url(r'^migrate/reload/(?P<reload_dir>[^/]+)/(?P<commit_id>[^/]+)$', 'lms_migration.migrate.manage_modulestores'),
391 392
        url(r'^gitreload$', 'lms_migration.migrate.gitreload'),
        url(r'^gitreload/(?P<reload_dir>[^/]+)$', 'lms_migration.migrate.gitreload'),
393 394
        )

395 396 397
if settings.MITX_FEATURES.get('ENABLE_SQL_TRACKING_LOGS'):
    urlpatterns += (
        url(r'^event_logs$', 'track.views.view_tracking_log'),
398
        url(r'^event_logs/(?P<args>.+)$', 'track.views.view_tracking_log'),
399 400
        )

Victor Shnayder committed
401 402 403 404 405 406
# FoldIt views
urlpatterns += (
    # The path is hardcoded into their app...
    url(r'^comm/foldit_ops', 'foldit.views.foldit_ops', name="foldit_ops"),
)

407 408
urlpatterns = patterns(*urlpatterns)

409
if settings.DEBUG:
410
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
411 412

#Custom error pages
413 414
handler404 = 'static_template_view.views.render_404'
handler500 = 'static_template_view.views.render_500'