django - Getting MEDIA images on Amazon S3 server on template -


the static files (css, js, images) serving local whilst media files (uploaded images , videos) on amazon s3 server in project.

i can upload media files amazon s3 without problem. cannot url's of files on templates.

i have tried static files , worked: (but static files on local)

 {% load static staticfiles %}  {% static "imagename.png" %} 

and how can media files?

 {% media "imagename.png" %} # maybe that? :) 

my settings file that:

  installed_apps: 'storages'    default_file_storage = 'storages.backends.s3boto.s3botostorage'   default_s3_path = "media"    media_root = '/%s/' % default_s3_path   upload_dir = media_root    media_url = '//s3.amazonaws.com/%s/media/' % aws_storage_bucket_name 

just putting {{ imagefield.url }} enough.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -