url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, }), # VIEW for displaying a single Course url(r'^' + SLUG.format('school_') + '/' + SLUG.format('') + '$', CourseDetailView.as_view(), name='course_detail'), ## NOTE MODEL # Valid url cases to the Note page # a: school/course/id # b: school/course/id/slug # c: s../c../slug # note file as id, for notes without titles yet url(r'^(?P<school_slug>[^/]+)/(?P<course_slug>[^/]+)/(?P<pk>[\d^/]+)$', \ NoteView.as_view(), name='note_detail_pk'), # note file by note.slug url(r'^' + SLUG.format('school_') + '/' + SLUG.format('course_') +'/'+ SLUG.format('') +'$', NoteView.as_view(), name='note_detail'), #url(r'^(?P<school_slug>[^/]+)/(?P<course_slug>[^/]+)/(?P<slug>[^/]+)$', \ # NoteView.as_view(), name='note_detail'), # ---- JSON views ----# # uploading files url(r'^ajax-upload$', ajax_uploader, name='ajax_upload'), # return json list of schools url(r'^school/list/$', school_list, name='json_school_list'), # ---- end JSON views ----# url(r'^$', CourseListView.as_view(model=Course), name='home'), )
url(r'^ajax/annotations/annotations$', set_delete_keyword_annotator, name='set_keyword'), url(r'^ajax/annotations/search/$', get_keywords_annotator, name='get_keywords'), # Valid url cases to the Note page # a: school/course/id # b: school/course/id/slug # c: s../c../slug # note file as id, for notes without titles yet url(r'^note/(?P<school_slug>[^/]+)/(?P<course_slug>[^/]+)/(?P<pk>[\d^/]+)$', \ NoteView.as_view(), name='note_detail_pk'), # note file by note.slug url(r'^note/' + SLUG.format('school_') + '/' + SLUG.format('course_') +'/'+ SLUG.format('') +'$', NoteView.as_view(), name='note_detail'), url(r'^note/' + SLUG.format('school_') + '/' + SLUG.format('course_') +'/'+ SLUG.format('') +'/keywords/$', NoteKeywordsView.as_view(), name='note_keywords'), url(r'^note/' + SLUG.format('school_') + '/' + SLUG.format('course_') +'/'+ SLUG.format('') +'/quiz/$', NoteQuizView.as_view(), name='note_quiz'), url(r'note/delete/$', NoteDeleteView.as_view(), name='note_delete'), url(r'^$', CourseListView.as_view(), name='home'), ) if settings.DEBUG: import debug_toolbar urlpatterns += patterns( '', url(r'^__debug__/', include(debug_toolbar.urls)), )
url( r"^note/(?P<school_slug>[^/]+)/(?P<course_slug>[^/]+)/(?P<pk>[\d^/]+)$", NoteView.as_view(), name="note_detail_pk", ), # note file by note.slug url( r"^note/" + SLUG.format("school_") + "/" + SLUG.format("course_") + "/" + SLUG.format("") + "$", NoteView.as_view(), name="note_detail", ), url( r"^note/" + SLUG.format("school_") + "/" + SLUG.format("course_") + "/" + SLUG.format("") + "/keywords/$", NoteKeywordsView.as_view(), name="note_keywords", ), url( r"^note/" + SLUG.format("school_") + "/" + SLUG.format("course_") + "/" + SLUG.format("") + "/quiz/$", NoteQuizView.as_view(), name="note_quiz", ), url(r"note/delete/$", NoteDeleteView.as_view(), name="note_delete"), url(r"^$", CourseListView.as_view(), name="home"), ) if settings.DEBUG: import debug_toolbar urlpatterns += patterns("", url(r"^__debug__/", include(debug_toolbar.urls)))