mirror of
https://github.com/jazzband/django-downloadview.git
synced 2026-03-16 22:40:25 +00:00
20 lines
519 B
Python
20 lines
519 B
Python
from django.core.files.storage import FileSystemStorage
|
|
|
|
from django_downloadview import StorageDownloadView
|
|
|
|
storage = FileSystemStorage()
|
|
|
|
|
|
#: Serve file using ``path`` argument.
|
|
static_path = StorageDownloadView.as_view(storage=storage)
|
|
|
|
|
|
class DynamicStorageDownloadView(StorageDownloadView):
|
|
"""Serve file of storage by path.upper()."""
|
|
|
|
def get_path(self):
|
|
"""Return uppercase path."""
|
|
return super().get_path().upper()
|
|
|
|
|
|
dynamic_path = DynamicStorageDownloadView.as_view(storage=storage)
|