django-filer icon indicating copy to clipboard operation
django-filer copied to clipboard

Download counter with Django-Filer

Open maltebeckmann opened this issue 8 years ago • 3 comments

Would there be an easy way to count the number of times a Django-Filer file is downloaded?

maltebeckmann avatar May 04 '16 01:05 maltebeckmann

  1. You need to create extra model that will store that information and view that will serve the files and increase the counter.
  2. You need to configure your web server not to serve the files under filer_public folder and instead to pass the request to Django in order your custom view to be able to serve the file.
  3. (Almost required) Because it's not a good idea Django to serve files in production your custom view probably need to leverage django-sendfile (https://pypi.python.org/pypi/django-sendfile) or similar approach of serving these files.

vstoykov avatar Jun 29 '16 14:06 vstoykov

@maltebeckmann I'm sorry because source code is in italian, but you can have a look at this https://github.com/CroceRossaItaliana/jorvik/blob/master/gestione_file/viste.py#L86 for an implementation of a download counter

yakky avatar Jun 29 '16 14:06 yakky

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 28 '22 23:07 stale[bot]

This will now be closed due to inactivity, but feel free to reopen it.

stale[bot] avatar Aug 30 '22 21:08 stale[bot]