Skip to content

Commit

Permalink
papers/ -> /media/files/papers
Browse files Browse the repository at this point in the history
This could have been done with x-sendfile too, but dreamhost doesn't
support it.
  • Loading branch information
Luís Pedro Coelho committed Oct 26, 2009
1 parent 579ed80 commit e980245
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions gitcms/publications/urls.py
Expand Up @@ -3,6 +3,7 @@
import views

urlpatterns = patterns('',
(r'^papers/(?P<paper>.+)$', views.papers),
(r'^publications/?$', views.publications, { 'collection' : 'luispedro' }),
(r'^publications/(?P<collection>.+)$', views.publications),
(r'^publications/files/(?P<file>.+)$', 'django.views.static.serve', {'document_root': settings._BASE_DIR + '/../media/publications/files'}),
Expand Down
6 changes: 6 additions & 0 deletions gitcms/publications/views.py
@@ -1,4 +1,5 @@
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect

def publications(request, collection):
if collection == '__history__.html':
Expand All @@ -11,3 +12,8 @@ def publications(request, collection):
{
'collection' : collection,
})

def papers(request, paper):
if paper == '':
return HttpResponseRedirect('/publications/')
return HttpResponseRedirect('/media/' + paper)

0 comments on commit e980245

Please sign in to comment.