Django on AWS for Chump Change
Below are the resources to my PyConAU 2024 talk "Django on AWS for Chump Change"
Pocket Notebook
I've tried a lot of productivity software over the years. I seem to churn through apps and systems fairly regularly. I suspect part of this is because I just need a change from time to time. My brain requires a reset and adopting a new system provides that demarcation line and some fresh energy. Lately though I've moved to a very analogue system for personal note taking.
Debug Django Management Commands In VSCode
Adding break points to a django management command in Visual Studio Code is one of those tasks that I’ve been wanting to achieve for a while but never really got around to investigating. I generally fell back on print statements which has been Good Enough.
Finishing Work On Docker Image aws-lambda-python-sqlite
AWS now has preview support for python 3.12 in their lambda docker images. They are built on the new Amazon Linux 2023 base images and as such stop the need for my hacky image aws-lambda-python-sqlite
.
Added Python 3.11 to aws-lambda-python-sqlite container
I went ahead and updated the build scripts for my custom AWS lambda container. Now there is Python 3.11 available with all its goodies.
manylinux2014 Multi Architecture Build
manylinux
is a linux distro created to provide the widest support possible for python packages. The folks at the Python Packaging Authority (PyPA) provide convenient docker images of this distro but due to the scale and issues of providing builds across multiple architectures the images are distributed under different tags for different architectures. I created a repo github action to aggregate these images into a multi architecture build using the docker manifest command.
Django Migrate Middleware
I created a python package that runs django migrations on every request. It seems silly but has been useful for creating almost stateless AWS Lambda functions using django.
No Growth
This end of year break my goal is to have no growth. No goals, no targets, no feeling guilty about not finishing that book or that side project.
Wiwa's Axiom for Python Virtual Environments In Containers
Don't.
Dev Container Features
Dev containers have been a thing for a while now in different forms and it looks like Microsoft is really trying to push them forward as a standard rather than something siloed off in Visual Studio Code. One of their latest additions to the spec is a feature creatively named features. I took the time to investigate them and write some of my own.
Setup Mangum in AWS Lambda for Django
Here's a quick setup guide to get mangum working as the request handler in a django project in AWS Lambda.
Australia and Pommel Horse
There is something so wrong and rigid about how we teach pommel horse in Australia.
In contrast we seem to be so savvy and inventive when it comes to high bar or even floor. Our "middle class" routines are adequate and serviceable.
Wiwa's Axion For Python Packaging
Python packaging will be "solved" when a packaging and dependency manager that is written in a compiled language becomes mainstream.
AWS Lambda and Django With Sqlite
Running Django on AWS Lambda has become fairly mainstream and there are many tools to assist with this goal. There is however a pain point which is admittedly not a conventional use case but a possible use case none the less. Django supports a version of sqlite that is above the current version supported on the underlying operating systems of the AWS python lambda implementation. If you're interested lambda functions run on Amazon Linux 1 and 2 which are based on CentOS 6 and 7 respectively.
Another Fresh Lick Of Paint
I finally found the time and space to do my semi regular migration to a new static site generator. I thought it was time to step away from Vue and try something new, partly out of curiosity and partly because I really like JSX as a templating language. And frankly I'm just not really up for the migration from Vue 2 to Vue 3.
Personal Notifications Using AWS
I've found quite a few uses for recurring and scheduled scripts in my personal life. In days gone by I would have run these in a cron job on a server somewhere but as I've gotten into the weeds of AWS infrastructure I've leant on some AWS services more for these little personal conveniences. My preference nowadays is to use AWS Lambda as my first point of call and integrate other services as I need them. I'm very confident that AWS won't be deprecating their Lambda platform and they connect well to Cloudwatch, meaning I don't have to worry about creating a logging solution. Additionally now that I'm pretty confident with the AWS CDK for spinning up infrastructure it's a breeze to connect other services to assist with any other needs. Today I'll go through one example which provided a flexible and cheap solution to my problem.
Fortune Teller by Xavier Rudd - Guitar Tabs
There are no good tabs for this track online so I finally figured it out and created them.
Docker Image With Multiple Python Installs
Not sure whether this has been done before but I created a docker container with four (4) Python installs. To get there I heavily abused Docker multistage builds from external images. You can check out the repo for the gory details. Now I'm not insane there is a specific reason why I did this.
Add the AWS CLI to a Dockerfile
Using the magic of multi-stage builds using external images and Amazon's official aws cli docker image it's actually pretty easy to add the AWS CLI to a huge amount of containers.
Importing Rootfs Ubuntu Images into WSL2
I've been generally impressed with the preview of Windows Subsystem for Linux 2 (WSL2) and it's integration between the windows desktop and the underlying linux kernel.
Dark Wiwa Published
I've been using my self made theme for Visual Studio Code for some time now. With every new installation of vscode I've had to manually copy and paste the project directory into the proper extensions directory. Couple this with the fact that I am now using the excellent Settings Sync extension to synchronise my setup between machines this manual copypasta becomes tiresome.
How To Link Your MyGov Account To Centrelink After A Name Change
My wife and I are about to have a baby, as such my wife is applying for paid parental leave which is painfully done through the Centrelink system. We also got married in the intervening years between us being on Centrelink regularly and now, and she subsequently decided to take my last name after our marriage. This has caused a headache linking accounts in her MyGov account since the information doesn't match and the system refuses to move forward. We eventually found a solution after tearing our hair out. I thought I would leave it here for any other lost souls who need this guidance.
JavaScript Remains The Best Deployment Target
It is abundantly clear that targeting the web, even as a Single Page App with heavy JavaScript, hits that sweet spot of development time, availability and cost.
Pinocchio
My siblings and I, when growing up, had a VHS tape of Pinocchio which we would watch on occasion. The interesting thing about it was that this was a very particular adaptation, not the one made famous by Disney but a decidedly creepier and more disturbing version. It left such a mark on us that it became a frequent topic of conversation when meeting for family events as adults. We described it with such disdain that our friends and significant others seemed sceptical as to how bad it could be. It appeared no amount of googling could find this mythical portrayal, until now.
A Good Year
It's that time to take stock of another year in my life and I think it's worthy of a blog post. Professionally and personally a lot has happened and I'm hoping the next year can be very much like it.
New Text Editor and Syntax Colour Scheme
After trying a few different text editors out, from the standard of gedit, to sublime text and even attempts at nano, I've standardised on Visual Studio Code which seems to be a standout for a few reasons. I'm not exactly an advanced programmer but when I am punching in a few crummy lines of python or writing some markdown notes I've reached for VSCode time and again. It seems to be both extremely flexible, as well as fairly intuitive. The VSCode's extension ecosystem and the git interface is straight forward and easy to use.
Does Driving Performance Degrade Or Improve With Increased Automation
During my studies I took a human factors and ergonomics course and found it quite interesting to see the implementation of human factors and how it relates to engineering in general. I was fascinated to study the psychology of how people in general accept certain designs. For better or worse here's an essay which I wrote answering the question "Does Driving Performance Degrade Or Improve With Increased Automation".
Toyplot - A Simple Python Plotting Library
My previous attempts at using python for plotting saw me use the massive and widely used library of Matplotlib. I managed to produce some workable plots which I exported to jpeg and used on one of my medium articles. Although extremely customisable and functional I began the search for a plotting library with a nicer API that would export to more web friendly formats such as html and SVG.
The 2020 Code of Points: What we might expect
The Code of Points for the 2020 Olympic cycle is official. The time has come to make some wild speculations about the consequences of these code changes.
Bottle URL Redirect
The little documented url method in bottle.py
The Code Of Points Format
For my own purposes I wanted to do some analysis of the Code of Points and I had little option but to scrape the important information from the current MAG Code of Points PDF file. I appreciate that the Code is now freely available online however if one wants to do any sort of analysis of the Code the PDF format is one of the more annoying formats to work with. As such I've made my scraping efforts available on github to anyone who would like to download it or make changes.
The Case Against Gymnastics Teams
There has been plenty of debate about the new team format for the current cycle and, as usual, nobody is happy. There is of course one solution to this problem which has not been talked about, although it appears to perhaps to be the most logical. Abolish all gymnastics teams. Get rid of them. Really reform the system. This is a radical solution I’ll admit but let me outline some reasons as to why this option may actually be very appealing.
A Dumping Ground
I have tried a few different iterations of personal websites and of online publishing in the past. Although I will still publish random thoughts on my favourite social media sites and longer thoughts tend to find their way to medium this platform might be a nice dumping ground for a few things. Mainly I intend for this to become a landing page for some personal projects and also a better place to leave more personal or technical ramblings.
The “We Say You Do” Model Of Code Review Is Broken
With the upcoming review and rehash of the Code of Points for the 2017–2020 cycle one thing is becoming increasingly clear, the FIG and requisite technical committees should do as students are told to do and show their working. The Code has been a living and morphing document since it’s inception. This needn’t change, however the way in which we go about modifications has to become a more data driven process.