Building A Simple Web App, Part 1 of N : Django

I’ve been exploring ways to build simple web apps that is modern enough without falling into the trap of whatever this week’s hot tech stack is. I am going to try to write down some thoughts about my experience with this, the choices I am making and why.

First off here’s the goals I have in mind

  • Simplicity – Complexity is always the enemy in software development. These days every system is actually crazy complex but the best environments don’t make you have to deal with that all the time
  • Expressiveness – I like to design and build at the same time so its important that the environment I work with makes it easy to try out new things
  • Ubiquity – I don’t want to be one of a small number of people using something. I want the tools to be well explored and documented.
  • Independence – I don’t want to have to choose where or how to deploy something based on the stack I used to build it. Choice also helps with optimizing for cost.

Backend: Django

For the main part of the server application I am going with Django/Postgres. There are plenty of other places people have discussed and debated the various benefits of different platforms but I am mostly sticking with this one because its one I know and it well used and supported. I have more experience with MySQL than Postgres but the majority of the world seems to be walking away from MySQL/Maria and Django has a few nice feature that are only supported in Postgres.

What I also like about Django (and Python) is that they both keep getting better. Django has done an amazing job of building more and more features into the platform without creating a mess and Python has continued to deliver new features that address many of its shortcomings now that the 2-3 transition is over.

Its possible there’s a better platform to start with but Django is Good Enough for just about anything.

I did look at things like React/NextJS but there’s just too much complexity in the setup for me to feel comfortable with it. All of these new frameworks which basically start you out with tons of config you don’t understand make me nervous. Every time in my life I have had a project.json file in my working directory it has ended up making me sad.

For sure Django also gives you a templated project to start with but it doesn’t feel as complicated or mysterious and there’s an enormous amount of resources online to help you. There’s also so many off the shelf additions you can get.

I am also aware the for a lot of people today Django means using something like Django rest framework to build an API and then coupling that with some other front end framework. I’m also choosing to not bother doing this right now. People may criticize the lack of starting with an API and building on that but In my opinion the API is something you make once you have a much better idea of what you are actually doing.

I decided that the simplest way to build is really using old school templates. This can make interactivity harder. I tried mixing in React and Django templates but found the impedance mismatch to be pretty ugly. Fortunately, I found HTMX, but that’s a subject for another post.

Some other posts in this series are:


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *