-
-
Notifications
You must be signed in to change notification settings - Fork 867
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
Consider a GenericStorage or SettingStorage #444
Comments
@fission6 Do you envision this like the database router? I am interested in that idea and see how it could useful for any sites that have a mix of public and private files. |
Similar to a router, yes, it can be controlled through settings file so it can change environment to environment and it came about for the reason you pointed out mix of public and private files AND things changing environment to environment |
So I think #524 is basically what you want. And then there is a minor feature request on top of that I think. |
@jschneier i really can't make immediate sense of whats going on in #524 at first glance, there is def a relationship between it and what I am proposing, but whats offered in this issue is what has proven to be a very flexible way to configure storages, similar to how you'd look to configure multiple databases as well as the luxury to easily change across staging environment perhaps @jdufresne can offer some thoughts too or find areas to squeeze the best from both sides |
@fission6 – thank you for this snippet! I was struggling to figure out a good way to select different storage backends for ImageFields based on the |
We went through with something like this. |
First off awesome work with django-storages its very very handy.
One issue I've run into is easily managing different storages on a model field level per environment. When I run locally everything can use the default storage but in production we need different subclasses of s3boto3storages. This makes it really tricky to manage as we flip back and forth between environments. Perhaps I am missing a better way to go about things but I whipped up this code which may be worth considering.
The concept is introduce a more Generic or Settings driven Storage class and leave the configuration of which storage backends to use in a typical settings file.
The text was updated successfully, but these errors were encountered: