How to set-up a Django project with django-storages and Amazon S3, but with different folders for static files and media files?

后端 未结 5 1459
情歌与酒
情歌与酒 2020-11-28 00:47

I\'m configuring a Django project that were using the server filesystem for storing the apps static files (STATIC_ROOT) and user uploaded files (MEDIA_ROO

5条回答
  •  粉色の甜心
    2020-11-28 01:27

    If you want to have subfolders even before media or static seperations, you can use AWS_LOCATION on top of bradenm answer. Reference: https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#usage

    AWS_STORAGE_BUCKET_NAME = 'bucket_name'
    AWS_LOCATION = 'path1/path2/'
    

提交回复
热议问题