当前位置: 动力学知识库 > 问答 > 编程问答 >

amazon s3 - Django - is MEDIA_URL still relevant with S3BotoStorage?

问题描述:

Perhaps a misconception on my part, I don't understand what is the purpose of MEDIA_URL and MEDIA_ROOT when using S3. The files are uploaded to the bucket so the root is never used, and the url of the ImageField is stored inside the image object so the MEDIA_URL is never used either. Is this correct? If not, please explain it so I can better understand how everything fits together.

My setup has three buckets:

static for js, css, templates, set as STATICFILES_STORAGE

media for user uploaded images, set as DEFAULT_FILE_STORAGE

spider for images scraped from other websites.

网友答案:

Given that you are using django-storages, you can safely remove these two variables from your settings.py file.

Both variables are used for when you are handling media files on the server itself.

分享给朋友:
您可能感兴趣的文章:
随机阅读: