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

Add a way to mock s3 for development

Open ABODFTW opened this issue 4 years ago • 5 comments

For people using this tool and developing it, I think it would make life easier if there is a documented way on how to mock s3, so there is no need for an AWS S3 account.

I.e

I'm not sure where to start, so if I can get some guidance, I would like to contribute

ABODFTW avatar Dec 30 '20 14:12 ABODFTW

Probably the quickest way to get what you want is the docker image for Localstack. It's not quite a mock, but it implements s3 and other AWS services locally without making a mess.

eyesee1 avatar Apr 13 '21 16:04 eyesee1

Oh thanks for the comment, I've settled with s3erver which is an npm package, and its been great so far.

But I think it would be good if we documented options, not everyone have access to s3 bucket.

If you think it's a good idea, let me know and I will send a pr

ABODFTW avatar Apr 23 '21 08:04 ABODFTW

Not sure about Localstack or s3erver, I'll just add minio as a relatively small (64mb docker image) s3-compatible server. Worked fine with django-storages for local development.

wodCZ avatar Apr 23 '21 09:04 wodCZ

I too would like to +1 for a way to - or ideas how to - implement "mock" upload to S3 functionality. In my case, I want a FileField during local development, and an S3DirectField in all other environments. Things I thought about / tried:

  • overriding the form URL field widget during init with a ClearableFileInput (doesn't work because a filefield and urlfield are two different things)
  • adding a null=True models.FileField() to my existing model containing the S3DirectField

Probably more elegant ways. Would love some ideas.

jaradc avatar Sep 22 '22 18:09 jaradc