From 9f2b2727dfa193707742ab6923cf680e05409a7c Mon Sep 17 00:00:00 2001 From: yomguy Date: Thu, 5 Apr 2012 00:14:49 +0200 Subject: [PATCH] add private files, fix urls --- example/settings.py | 2 ++ example/urls.py | 10 +--------- teleforma/urls.py | 10 ++++++++++ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/example/settings.py b/example/settings.py index 4c38b4d4..e169232c 100644 --- a/example/settings.py +++ b/example/settings.py @@ -136,6 +136,7 @@ INSTALLED_APPS = ( 'django_extensions', 'pagination', 'postman', + 'private_files', ) TEMPLATE_CONTEXT_PROCESSORS = ( @@ -167,3 +168,4 @@ DEFAULT_FROM_EMAIL = 'webmaster@parisson.com' POSTMAN_AUTO_MODERATE_AS=True +FILE_PROTECTION_METHOD = 'basic' diff --git a/example/urls.py b/example/urls.py index cd4c29c0..2166f3a7 100644 --- a/example/urls.py +++ b/example/urls.py @@ -16,19 +16,11 @@ urlpatterns = patterns('', # Uncomment the admin/doc line below and add 'django.contrib.admindocs' # to INSTALLED_APPS to enable admin documentation: # (r'^admin/doc/', include('django.contrib.admindocs.urls')), - - # Uncomment the next line to enable the admin: - (r'^admin/django/', include(admin.site.urls)), - - # Telemeta - (r'^', include('telemeta.urls')), + url(r'^admin/django/', include(admin.site.urls)), # TeleForma (r'^', include('teleforma.urls')), - # Postman - (r'^messages/', include('postman.urls')), - # Languages (r'^i18n/', include('django.conf.urls.i18n')), (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict), diff --git a/teleforma/urls.py b/teleforma/urls.py index 8094631a..ce887552 100644 --- a/teleforma/urls.py +++ b/teleforma/urls.py @@ -44,12 +44,19 @@ htdocs_forma = os.path.dirname(__file__) + '/htdocs' urlpatterns = patterns('', + # Telemeta + url(r'^', include('telemeta.urls')), + url(r'^desk/courses/$', CoursesView.as_view(), name="teleforma-courses"), url(r'^desk/courses/(?P.*)$', CourseView.as_view(), name="teleforma-course-detail"), url(r'^desk/medias/(?P.*)$', MediaView.as_view(), name="teleforma-media-detail"), url(r'^desk/documents/(?P.*)/download/', document_download, name="teleforma-document-download"), url(r'^desk/documents/(?P.*)/view/', document_view, name="teleforma-document-view"), + # Postman + url(r'^messages/', include('postman.urls')), + + # CSS+Images (FIXME: for developement only) url(r'^teleforma/css/(?P.*)$', 'django.views.static.serve', {'document_root': htdocs_forma+'/css'}, @@ -64,4 +71,7 @@ urlpatterns = patterns('', # JSON RPC url(r'json/$', jsonrpc_site.dispatch, name='jsonrpc_mountpoint'), + url(r'^private_files/', include('private_files.urls')), + + ) -- 2.39.5