4

Django Filebrowser does not work well with storage services.

Django Filer found on Django Packages seems like a good alternative but its support of storage backends seems incomplete.

I would like to know what are other alternatives to Django's File Browser that integrate well with S3.

howtodothis
  • 1,265
  • 4
  • 17
  • 30

2 Answers2

0

I've used https://github.com/bradleyg/django-s3direct in my project. It worked nice. It is also listed on Django Packages site you mentioned.

Dmytriy Voloshyn
  • 1,032
  • 12
  • 27
0

When you include the S3BotoStorageMixin, this package should be able to work on S3.

from filebrowser.storage import S3BotoStorageMixin
from storages.backends.s3boto import S3BotoStorage


class CustomS3BotoStorage(S3BotoStorageMixin, S3BotoStorage):
    def path(self, name):
        # Workaround for django-filebrowser, which requests full_path on uploaded files.
        # The operation is not needed at all, since no chmod happens afterwards.
        return self.url(name)

    def isfile(self, name):
        # Hacky performance optimization for filebrowser.
        # The original isdir() method is really inefficient.
        if '.' in name:
            return True
        return super().isfile(name)

and in settings.py:

DEFAULT_FILE_STORAGE = 'myproject.lib.storages.CustomS3BotoStorage'
vdboor
  • 21,914
  • 12
  • 83
  • 96