DJango use templates from seperrate AWS S3 Bucket

585 views Asked by At

I have a Django server running in an elastic beanstalk environment. I would like to have it render HTML templates pulled from a separate AWS S3 Bucket. I am using the Django-storages library, which lets me use static and media files from the bucket, but I can't figure out how to get it to render templates.

The reasoning for doing it like this is that once my site is running, I would like to be able to add these HTML templates without having to redeploy the entire site.

Thank you

1

There are 1 answers

0
Himanshu Pant On

To my best knowledge, Django-storages is responsible for managing static assets and media files, it doesn't mount the S3 bucket to the file system, what you might be looking for is something like S3Fuse which will mount the bucket on the File System, which will allow you to update the template and have them sync. This might not be the best solution because even if you got the sync to work, Django might not pick those changes and serve the templates from memory. I believe what you're looking for is a Continuous Delivery pipeline, that way you won't be worried about hosting. Good Question though.