python-django-storages

Django storages: Import Error - no module named storages

痞子三分冷 提交于 2020-03-21 11:53:41
问题 I'm trying to use Django's storages backend (for BotoS3) settings.py: INSTALLED_APPS = ( ... 'storages', ... ) as shown in http://django-storages.readthedocs.org/en/latest/index.html. and, requirements.txt: django-storages==1.1.8 But am getting the error: django.core.exceptions.ImproperlyConfigured: ImportError storages: No module named storages What am I doing wrong? 回答1: There is a possibility that you are in a virtualenv and installing the package outside the virtualenv into the default

Django storages S3 - Store existing file

谁说胖子不能爱 提交于 2020-01-24 14:12:48
问题 I have django 1.11 with latest django-storages, setup with S3 backend. I am trying to programatically instantiate an ImageFile, using the AWS image link as a starting point. I cannot figure out how to do this looking at the source / documentation. I assume I need to create a file, and give it the path derived from the url without the domain, but I can't find exactly how. The final aim of this is to programatically create wagtail Image objects, that point to S3 images (So pass the new

Django Storages - Could Not Load Amazon's S3 Bindings Errors

老子叫甜甜 提交于 2019-12-22 01:55:21
问题 Hey so trying to connect my user uploaded images to my S3 bucket so the images will store there. Using django storages (did some research, seemed to be what everyone suggested, but open to ideas) Here's what I did: Installed django storages pip install django-storages Added it to my INSTALLED_APPS #settings.py INSTALLED_APPS = ( ... 'storages', ) And added this code as well to settings.py #settings.py DEFAULT_FILE_STORAGE = 'storages.backends.s3.S3Storage' AWS_ACCESS_KEY_ID = '###############

django-storages and amazon s3 - suspiciousoperation

雨燕双飞 提交于 2019-12-12 08:31:39
问题 I'm using django-storages with Amazon S3. I see the following error somewhat intermittently: name = self._normalize_name(self._clean_name(name))\n\n File \"/app/.heroku/venv/lib/python2.7/site-packages/storages/backends/s3boto.py\", line 237, in _normalize_name\n name)\n\nSuspiciousOperation: Attempted access to 'https:/plantvillage.s3.amazonaws.com/avatar/hans9_avatar.jpg' Note the single / after https: . Does anyone know why this shows up? It doesn't happen all the time. I can successfully

django-storages with multiple S3 Buckets

巧了我就是萌 提交于 2019-11-28 04:43:34
I am using AWS and I will have different buckets in my application. I am also using Django-Storages. Is there a way to specify which bucket I want to upload the file to (for example, as a parameter in the Save() function or whatever?) I saw this Django - Error importing storages.backends , but I don't understand how it should be used?! Mark Lavin S3BotoStorage takes the bucket name as a parameter. If not given it will use the AWS_STORAGE_BUCKET_NAME setting. That means if you want to make S3BotoStorage the default storage backend with DEFAULT_FILE_STORAGE then it must use the default bucket.

django-storages with multiple S3 Buckets

此生再无相见时 提交于 2019-11-27 00:29:43
问题 I am using AWS and I will have different buckets in my application. I am also using Django-Storages. Is there a way to specify which bucket I want to upload the file to (for example, as a parameter in the Save() function or whatever?) I saw this Django - Error importing storages.backends, but I don't understand how it should be used?! 回答1: S3BotoStorage takes the bucket name as a parameter. If not given it will use the AWS_STORAGE_BUCKET_NAME setting. That means if you want to make