django-storage

Django media uploads to AS3

自作多情 提交于 2019-12-11 11:58:05
问题 I'm trying to upload all the Django media files (uploaded from the admin panel) to Amazon S3. So settings file look something like this : INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin', 'tastypie', 'core', 'advertisment', 'storages', ) DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' AWS_ACCESS_KEY_ID = 'xxx' AWS_SECRET

Heroku + S3 + Django: Static Files not Cached

☆樱花仙子☆ 提交于 2019-12-11 07:35:43
问题 Currently have a project deployed on Heroku with static files loaded from S3. I'm using boto/django-storage to manage my S3 content, but if I call the same view or load the same page repeatedly, all the images/static content load twice and is not cached. I've placed AWS_HEADERS = { 'Cache-Control': 'max-age=2592000', } in my settings.py , but the reason seems the same exact images (refreshed + loaded twice) have different signatures in their URL? I've tried multiples headers, but the browser

Trying to understand Django source code and cause of missing argument TypeError

让人想犯罪 __ 提交于 2019-12-10 18:45:46
问题 A screenshot (portrait view) of my IDE and Traceback showing all the code pasted here, may be easier to read if you have a vertical monitor. Context: Trying to save image from a URL to a Django ImageField hosted on EC2 with files on S3 using S3BotoStorage. I'm confused because all of this suggests that Django is still treating it like local storage, while it should S3. The lines in question that seem to be causing the error: def get_filename(self, filename): return os.path.normpath(self

django-storages using boto - cannot upload mp3, but can upload an image. Also, suffering HTTP 307 pain

僤鯓⒐⒋嵵緔 提交于 2019-12-10 13:28:39
问题 Am using the boto (2.2.1) backend for django-storages (1.1.4) to upload files to an S3 bucket. It works fine for images, but when I try to upload movie files (small mov, small avi) or an mp3, i get a Broken pipe error. This is Weird. Digging into the Django traceback, I get see the following exception: boto.https_connection.InvalidCertificateException Which kind of fits the experience I've been having using Cyberduck to inspect the bucket directly: sometimes it complains that I'm getting a

Connection reset by peer when using s3, boto, django-storage for static files

冷暖自知 提交于 2019-12-09 14:27:25
问题 I'm trying to switch to use amazon s3 to host our static files for our django project. I am using django, boto, django-storage and django-compressor. When I run collect static on my dev server, I get the error socket.error: [Errno 104] Connection reset by peer The size of all of my static files is 74MB, which doesnt seem too large. Has anyone seen this before, or have any debugging tips? Here is the full trace. Traceback (most recent call last): File "./manage.py", line 10, in <module>

Django storage s3 media url is https:// instead of http://

孤街醉人 提交于 2019-12-09 09:10:31
问题 When serving media with django-storage s3, the media url that is being generated is something like this: https://mybucket.s3.amazonaws.com/myimage.jpg?Signature=5ifoyLqzmtfVNS1ovfzVvN92RH0%3D&Expires=1363124819&AWSAccessKeyId=AKIAJ7ZTU7K4SPYKGOFA Causing the images to not be displayed because of https: You attempted to reach mybucket.s3.amazonaws.com, but instead you actually reached a server identifying itself as *.s3.amazonaws.com. This may be caused by a misconfiguration on the server or

Django won't serve static files from Amazon S3 with custom domain

孤街浪徒 提交于 2019-12-08 04:43:08
问题 I did setup my Django project, DNS and bucket on Amazon S3 but python manage.py collectstatic and therefore also files uploaded manually won't works. AWS S3 Settings: Bucket name: files.domain.com Bucket policy: { "Id": "Policy1483363850641", "Version": "2012-10-17", "Statement": [ { "Sid": "Stmt1483363848944", "Action": "s3:*", "Effect": "Allow", "Resource": "arn:aws:s3:::files.domain.com/*", "Principal": "*" } ] } DNS Settings: files.domain.com -> CNAME -> files.domain.com.s3.amazonaws.com

default_storage.exists extremely slow and frequently times out

我的未来我决定 提交于 2019-12-08 01:20:21
问题 We have just migrated a Django project to Heroku and put all of our media and static files on Amazon S3 (using django-storages and s3-boto). Despite everything I've heard about Amazon S3 being very fast, and turning up very few results on slow performance, our image loading has slowed to an absolute crawl and frequently times out. An example of the code that is timing out is this property on one of our models, which tries to select an appropriate image, ultimately falling back to returning

Configuring django-compressor with remote storage (django-storage - amazon s3)

房东的猫 提交于 2019-12-07 03:30:38
问题 My scenario I'm using django-storage to have the files served via Amazon S3. This means that when I do ./manage.py collectstatic, the files will be saved on my bucket at amazon and not on the local file system. To compress the files I do: "./manage.py compress" Which gives this error: Error: An error occured during rendering: [Errno 2] No such file or directory: u'/home/user/project/static/less/bootstrap.less' Since the file isn't on my local filesystem. "Due to the way Django Compressor

Serving Django's static and media files from S3

冷暖自知 提交于 2019-12-07 03:06:20
问题 I'm having a weird problem and I have no idea what's causing it. Here's my current config (using Heroku ): MEDIA_URL = '/media/' STATIC_URL = '/static/' STATICFILES_DIRS = ( os.path.join(PROJECT_DIR, '../static'), ) #Determine if local or deployed. if 'DATABASE_URL' in os.environ: STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage' AWS_ACCESS_KEY_ID = 'A...A' AWS_SECRET_ACCESS_KEY = '...R' DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' # PRODUCTION OR STAGING if