Skip to content

Commit 2e5594f

Browse files
committed
Fix #110 -- Enable S3Input support for dummy storage
1 parent faf7527 commit 2e5594f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

README.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ you do not need to alter your code at all.
6868

6969
The ``ClearableFileInput`` widget is only than automatically replaced
7070
when the ``DEFAULT_FILE_STORAGE`` setting is set to
71-
``django-storages``\ ’ ``S3Boto3Storage``.
71+
``django-storages``\ ’ ``S3Boto3Storage`` or the dummy ``FileSystemStorage``
72+
is enabled.
7273

7374
Setting up the AWS S3 bucket
7475
----------------------------

s3file/apps.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ class S3FileConfig(AppConfig):
1010

1111
def ready(self):
1212
from django import forms
13-
from django.core.files.storage import default_storage
13+
from django.core.files.storage import FileSystemStorage, default_storage
1414
from storages.backends.s3boto3 import S3Boto3Storage
1515

1616
from .forms import S3FileInputMixin
1717

18-
if isinstance(default_storage, S3Boto3Storage) and \
18+
if isinstance(default_storage, (S3Boto3Storage, FileSystemStorage)) and \
1919
S3FileInputMixin not in forms.ClearableFileInput.__bases__:
2020
forms.ClearableFileInput.__bases__ = \
2121
(S3FileInputMixin,) + forms.ClearableFileInput.__bases__

0 commit comments

Comments
 (0)