Skip to content

Usage as a non-default media storage engine #31

@jayvdb

Description

@jayvdb

So far all db media storage engines I have found all expect DEFAULT_FILE_STORAGE = '...'.

I am looking for the ability to have another storage (S3) as the default which is needed for most of the apps in the project, but use db storage for limited cases , and in my case the creation of the media files is done within the app server. i.e. I dont need to supported media uploaded into the app server. Specifically I am wanting to store invoices which we don't want pushed out to a media server. I have complete control over the code which is pushing the blob into the db, so I can instantiate a non-default storage class, and use it in any strange manner in order to get the blob into the database field.

It would be nice if the stored field in the model also knows how to get the data back out without any extra voodoo, or at least a ModelAdmin mixin that can be added to contain the extra logic so the file can be downloaded there. The Field would need to know which storage engine to use.

I am happy to muck around and experiment, but it would be nice to know from the experts here that this is not possible / has significant hurdles, and also whether this project is interested in a PR with the solution.

Or if this is already possible, it would be helpful to add the voodoo into the README or an "Advanced" docs page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions