Comments (5)
I most often edit the migration files, import the module where I defined the storage and replace the storage=django_s3_storage...
part with storage=app.storages.s3_storage
or something.
It's not really recommended to import files from the project in migrations since you cannot move around anything without updating historical migrations as well. Since I add a module only for storages and I do not update it if possible at all after introducing it initially I'm fine.
(Customizing the deconstruction of the storage would be possible as well, but I sort-of like the workaround above even better.)
from django-s3-storage.
That's quite a problem!
The reason this comes about is that it's possible to have loads of different storage backends, all used in different model fields, and all will have their setting included in the migration. This is by design, and hard to change, even if it was desired. Presumably we'd need to differentiate between arguments passed via settings and via explicit settings.
The workaround from @matthiask is fine.
from django-s3-storage.
Thanks for the workaround, I will give it a try. I'm glad I noticed it before applying migrations to production. Out of curiosity, had I done that, where would the now-incorrect settings be visible? And would it be sending things to the wrong bucket or taking the settings set at runtime?
from django-s3-storage.
from django-s3-storage.
Ah, I see, thank you. I appreciate the help.
from django-s3-storage.
Related Issues (20)
- Allow the storage to work in a Docker environment HOT 4
- How to delete record which used django-s3-storge HOT 3
- I am defined AWS_S3_ENDPOINT_URL in settings but still use default S3 endpoint url HOT 2
- if I am using rotated s3 credentials how do I setup credentials HOT 2
- Is there a way to get upload progress? HOT 4
- support for large file upload HOT 2
- Setting similar to `AWS_S3_KEY_PREFIX` but instead prepend a dynamic param for each model's files HOT 2
- Caching with pre-signed url HOT 7
- sha1 or other hash before upload? HOT 6
- Public-read buckets and AWS_S3_BUCKET_AUTH HOT 4
- File is closed after s3 upload HOT 9
- Incompatibility issues with Django>=4.0 HOT 1
- Issue when upgrading to version 0.13.5 or higher HOT 4
- Huge Thanks HOT 2
- Update settings to define multiple S3 buckets HOT 1
- Document the `AWS_S3_MAX_POOL_CONNECTIONS` setting HOT 1
- Issues configuring AWS_S3_ENDPOINT_URL HOT 2
- Use Django's system check framework instead of log message HOT 1
- Cannot open files in plain text mode HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-s3-storage.