-->

Upload files to DEFAULT_FILE_STORAGE instead of Gr

2019-02-20 21:25发布

问题:

I want to be able to store files in amazon s3. The FileField in mongoengine seems to be hardcoded with gridfs.

What can I do to achieve this?

Is there a custom filefield out there, that behaves like the regular django FileField?

回答1:

I havent seen an S3 FileField for use with MongoEngine - so currently, you'd have to roll your own implementation - you could use a StringField to store the location or you could create your own proxy_class like ImageField but it is quite tided to GridFs but I'm happy to abstract that away if needed.

As always pull requests welcome! https://github.com/MongoEngine/mongoengine