A Static Revolution
Blog Home

A Static Revolution

July 9, 2019 |  Categories:  Learning   Development  

So the first order of business in renovating and improving my website will be migrating all of my static and media files to a remotely-hosted S3 bucket provided by Amazon Web Services (AWS). Not only will this provide faster loading times for many of my website’s features, but it will also ensure that my files are accessible in the first place. Because Heroku, my site’s hosting platform, uses an ephemeral file storage system, all files attached to my website that are not associated with its slug are deleted each time a dyno (referring to the host server) is restarted. While this isn’t necessarily a problem for the static images found throughout my site, it IS a problem for the media images associated with my project portfolio. By hosting all of my static and media files on a remote service, I can bypass this shortfall and ensure consistent delivery of my site’s contents. Transitioning to this new storage paradigm, however, has proven to be difficult so far. First, I had to create an account with Amazon Web Services to gain access to their S3 storage service. Then, I created a bucket that will eventually hold all of my files and then granted myself read and write privileges for this bucket. At present, I’m downloading the Docker app for Mac to make use of the Django-Docker program developed by mjhea0 over on [GitHub][1]. More generally, Docker is an open-source tool that packages all the libraries and dependencies of a program into a single container for easy export to other machines. As it relates to my project, the Django-Docker program automates this export of my static files to my S3 bucket. That, at least, is how I understand everything at the moment. Much of this is brand new to me, and I’ve struggled at times to wrap my head around how all of these things relate to one another. But once Docker finally finishes downloading (521 MB is a lot on a slow internet connection!), the rest of the process should be relatively straightforward. Hopefully my next blog post will be filled with good news about how easy this was to implement~ -Joe [1]: https://github.com/testdrivenio/django-docker-s3

Leave a comment:

Comments:

Hello!

I'm Joe Pickert, and welcome to my blog.

Here, you can find a collection of my thoughts both tech-related and otherwise.

If you find something that interests you, please leave a comment! I'd love to hear your thoughts and feedback!