joe curlee

Why I created a Static Site Jan. 11, 2025, 3:37 p.m.

In this post, I discuss my decision to build a static blog using Django with Django Distill instead of a Single Page Application (SPA) with React.

In my previous post I briefly talked about how I used Django to create a static blog hosted on Github Pages for free. One of the decisions I faced was whether or not to create a Single Page Application using something like Ghost. Ultimately I decided against this in favor of pre-composing the site using Django Distill.

Why not a Single Page Application?

My previous site was built with React. At the time, Single Page Applications (SPAs) were all the rage, React had just been released and I wanted to gain some experience in using the library. I had previously worked with Angular (albeit very briefly) and was unhappy with the complexity. React is easy to understand and was similar to a SPA library I had created myself with Backbone, so I was excited to dive in. It remains my preferred library for building SPAs, however I decided against building my site as an SPA this time around for a few reasons.

First, I decided I wanted to build this site without JavaScript because I simply don’t need it. Although SPAs allegedly provide a smoother and more responsive user experience by loading content dynamically and without refreshing the entire page, they sometimes tend to feel clunky and require downloading a bundle of JS.

Maintaining a JS site can be time consuming and insecure. Installing anything like React requires many third-party libraries and the complexity. I wanted to deal with fewer dependencies.

SEO can be a challenge with JS sites, and indeed my website was facing issues with SEO, particularly on Bing (which in turn affects DuckDuckGo and Yahoo search).

Although I was using React Router, I was still facing challenges with history and navigation as my site is hosted on Github pages.

Why Django?

I have a lot of experience with Django and Python. I’ve been using Django for various projects for over 10 years, and Python is my language of choice, I’ve created some very complex applications with it. Django comes with some great features like the admin which I can take advantage of on my local machine prior to deploying, and I can easily customize anything I wish without adding very much complexity to the site.

Although I’m not using React (or any JavaScript) here, I haven’t completely sworn it off. There are certainly use-cases where it makes sense to choose an SPA over a static site, however I don’t think building an SPA should be the default decision one should make. Like any project, when building a website one should carefully consider the requirements of the site and build accordingly.

Blog Archives