Comments (3)
I see your use case now, and, as this will be backward compatible, we can include this in the package.
As I am quite busy recently, so I would really appreciate PR. Please include a test for this case.
from django-cloudinary-storage.
Why do you need this? Cloudinary storage is just a custom Django storage implementation, which can be used for both static and media files. The default Django storages use MEDIA_URL and STATIC_URL settings, and in my opinion there is no need to introduce dedicated prefix settings for CLOUDINARY_STORAGE, as it would cause a following problems:
- unnecessary API pollution
- making CLOUDINARY_STORAGE less portable - the less work needs to be done when changing storages, the better
from django-cloudinary-storage.
I have
DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
MEDIA_URL = '/uploaded/'
but for some models/fields used cloudinary_storage.storage.MediaCloudinaryStorage
and ran into side effect that all files uploaded at cloudinary via cloudinary_storage prefixed by '/uploaded/'
Code change is minimal, simple and 100% backward compatible. In app_settings.py add new line:
PREFIX = user_settings.get('PREFIX', settings.MEDIA_URL)
In storage.py change _get_prefix
method to:
def _get_prefix(self):
return app_settings.PREFIX
May be for most cloudinary-storage users it is not principal and they will never change that setting, but it make sense in my case.
from django-cloudinary-storage.
Related Issues (20)
- Implement upload options HOT 1
- File size too large -- but it isn't HOT 7
- How to get the full path HOT 5
- How can I delete an image each time I delete the instance asociated with it? HOT 4
- Add ability to manipualate option upload in settings.py HOT 1
- Django-utils.six dropped in Django 3.x HOT 9
- Unable to load large videos HOT 3
- Cannot find valid magic files. HOT 8
- Switch to Poetry with better dependency pinning
- issue with exists for raw files HOT 3
- Issue with uploading Django CKEditor images to cloudinary HOT 7
- This backend doesn't support absolute paths HOT 3
- This backend doesn't support absolute paths. HOT 2
- Unsupported video format or file HOT 3
- Can I set uppload option to private? HOT 5
- Static files don't work HOT 4
- How to apply cloudinary transformations outside of templates
- expected str, bytes or os.PathLike object, not NoneType HOT 1
- Error during management command: deleteredundantstatic
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-cloudinary-storage.