From: Seth Woodworth Date: Thu, 13 Jun 2013 19:00:48 +0000 (-0400) Subject: add media route for pdf handling X-Git-Tag: release-20150131~420 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7d14a8e7983e46240960b150e5368a9f20027f99;p=oweals%2Fkarmaworld.git add media route for pdf handling --- diff --git a/karmaworld/urls.py b/karmaworld/urls.py index f6b52cc..817394e 100644 --- a/karmaworld/urls.py +++ b/karmaworld/urls.py @@ -4,6 +4,7 @@ """ Controller for the KarmaNotes website """ from django.contrib import admin +from django.conf import settings from django.conf.urls.defaults import patterns, include, url from django.views.generic.simple import direct_to_template @@ -38,6 +39,10 @@ urlpatterns = patterns('', #url(r'^pdfview$', PDFView.as_view(), name='pdf'), url(r'^pdfview/(?P\d+)$', PDFView.as_view(), name='pdf'), + # Media handling + url(r'^media/(?P.*)$', 'django.views.static.serve', + {'document_root': settings.MEDIA_ROOT, }), + # VIEW for displaying a single Course url(r'^(?P[^/]+)/(?P[-A-Za-z0-9_]+)$', \ CourseDetailView.as_view(), name='course_detail'),