-
Notifications
You must be signed in to change notification settings - Fork 21
Usage as a non-default media storage engine #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Based on the tests, it looks like it might be possible using |
#32 adjusts the tests to ensure that they do not unnecessarily rely on Seems to work well as non-default. We just need to describe it in the readme or elsewhere. |
@jayvdb Would you want to add some text about that to the readme? |
sure. What I propose is that the README should first provide an example model which uses Then mention that if all files in all models should be stored in the db, My reason for that order is that a model which uses Does that sound ok? |
sure, sounds good |
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.
The text was updated successfully, but these errors were encountered: