Blog / Software Development

How to enable 2FA in the Django admin

July 14, 2021

I remember the first time I've used 2FA (two-factor authentication) was over 12 years ago when I worked as a sysadmin/netadmin in a Windows environment.  We had to purchase this RSA appliance/server and pay separate licenses for each user in the system.

Back in those days, we also used these keyfobs with a simple screen showing the 6-digit number that automatically refreshes every x seconds.  I actually thought those were really cool and when they …

Setting up additional entropy for your Ubuntu VPS with haveged

June 28, 2020

We've recently ran into an issue with one of our staging servers where a scheduled cron job would occassionally hang for a few minutes before executing.  The issue turned out to be due to a low entopy (i.e. randomness) value in /proc/sys/kernel/random/entropy_avail.

Randomness in Linux is generated from hardware interrupts such as the keyboard, mouse, and disk/network IO.  This goes into a pool which then gets consumed by applications that require randomness for security, such as …

The Joy of Refactoring

October 4, 2019

I spent a good part of last month refactoring a decent portion of the codebase of our Shopify data exporter app, EZ Exporter.

There are 3 main motivations I decided to invest this much time in refactoring:

  • Optimization.
  • Preparing the codebase for new features.
  • Reduce maintenance cost/complexity/technical debt.

Refactoring is the process of improving the code's structure and design, which I actually quite enjoy. I'm a bit of a minimalist and I find cutting …

Easily convert XML data to a Python dict with xmltodict

September 1, 2019

I hate working with XML mainly because I find it difficult to read.

There's a popular Python package for parsing XML called lxml which is very flexible, but I found xmltodict much better suited and easier to use for what I needed to do.

We have a inventory management app for Shopify, EZ Inventory, and one of the features we've added recently is XML support. We have a few customers whose suppliers can only …

Dealing with datetime objects and time zones in Python 3

June 29, 2019

Working with datetime objects and time zones is one of those things I always struggle with when writing code in Python. I always have to look things up and double check the outputs (such as making sure daylight savings time was taken into account) to make sure I'm doing things correctly.

This blog post is really more of a reference for myself when making adjustments to datetime objects that involve time zones so I won't …

Older