Giter Club home page Giter Club logo

Comments (5)

matthiask avatar matthiask commented on August 30, 2024

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.

etianen avatar etianen commented on August 30, 2024

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.

saberworks avatar saberworks commented on August 30, 2024

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.

etianen avatar etianen commented on August 30, 2024

from django-s3-storage.

saberworks avatar saberworks commented on August 30, 2024

Ah, I see, thank you. I appreciate the help.

from django-s3-storage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.