Is there a way to configure django’s collectstatic command to upload to a subdirectory in an s3 bucket, rather than just the top level directory?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re using the
S3BotoStorageengine fromdjango-storagesthen there’s a settings variable calledAWS_LOCATIONwhich will set the key prefix (equivalent to subdirectory) for the S3 bucket you specify inAWS_STORAGE_BUCKET_NAME.Note that I haven’t used this with
collectstatic, but I can’t see how it wouldn’t work given the separation between it and the storage engines.