Despite using Django for a number of years, I haven’t really worked with Django’s Forms until this week. I needed to create a form to handle a file upload, which has an associated category. The form also had to allow users to create new categories from within the …
At a local Python meetup, there were several attendees that weren't familiar with pytest , which gave me the idea to make this post as a primer on how I use pytest . This isn't going to be a comprehensive review of pytest and how to use it. For that, pick up …
I've been a big fan of coffee for many years, but it's only in the last few that I've really started diving deeper on coffee and its preparation. I don't have an espresso machine, so most of my consumption at home is prepared as a pour over. I've almost always …
I recently had issues with long running postgres operations and found these two commands, one for finding long running queries, and one for killing them. My issue turned out to be with an UPDATE instead of a query, but I'm noting this for future use. Note that the interval can …
TL;DR: Instead of && use ; after a command that might have errors. My main project at work has a nice Make command for getting a new truncated version of our main database. Unfortunately, I can never remember the exact command, and it requires a second command ( pg_restore ) to update my …
I set up my main project at work to utilize LocalStack this week. I wasn't able to get it working using a virtual environment with Python, but another project at work has it set up through Docker. A coworker that is much more familiar with Docker than I am helped …
For a while now, I've felt unsure about mocking in Python. It has helped me test in the past, but I've also seen a lot of smart people talk or write about its pitfalls. Recently, I had to test some functionality around calls to Twilio, so I decided to investigate …
Like my previous vs post , this isn't a showdown. Instead, this post is about matching the solution to the problem. The tl;dr is that Celery is great at what it does, but it requires more infrastructure and setup than I needed to solve my problem. The Problem to Solve …
In writing for this blog, there are some posts I'd like to write that I don't think quite fit the theme of this blog. For example, I want to write short book reviews to link to from my books page , but I don't want them showing up on the index …
I recently * read Timo Zimmermann's post about buying a 'keyboard to last' and it made me realize I haven't posted about my keyboard journey yet. If you don't know much about mechanical keyboards, Brett Cannon's post about deciding on a new keyboard has a lot of great info. It also …
For longer than I care to admit, I was running my end to end tests in only Firefox. I thought it would be trivial to add a fixture to have my tests run using multiple browsers. Unfortunately, there isn't an easy way in pytest to use fixtures as parametrized values …
For the tl;dr instructions, feel free to skip to the last two paragraphs. Years ago, I used SourceTree for visualizing my git graph. At some point, SourceTree became bloated and I really didn't like the direction it went, so I looked around for alternatives. I forget if I settled …
At work last week, I was asked to write tests for code that reaches out to Twilio's verify service. Here is what that code looks like (from the Twilio docs ): client = Client ( account_sid , auth_token ) verification = client . verify \ . v2 \ . services ( 'VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ) \ . verifications \ . create ( to = '+15017122661' , channel = 'sms' ) I was able to …
At DjangoConUS 2023, I gave a lighting talk with this title. It was a lot of fun, and I'd suggest you try to give a lightning talk if you haven't before. It's a great way to try giving a talk at a conference without having to commit to a full …
I'd like to run a few small apps I've been developing for learning purposes (to do list, etc.) on a cheap or free platform as a service (PaaS) provider so I don't have to worry about a full deployment setup like I have on my main project . These projects aren't …
At DjangoConUS 2019, Carlton Gibson gave a talk called Using Django as a Micro-Framework , where he demonstrated a single file implementation of "Hello, World!" in Django. At the sprints during DjangoConUS 2023, Paolo Melchiorre showed off an even more minimal version that sparked some great discussion. Specifically, the usage of …
Since my last post on aliases , I've added a few new aliases. Two are from Boost Your Django DX , which I'd highly recommend. The first is a straight cut from the book: alias pip="python -m pip" Using python -m pip instead of pip ensures you are using the version …
I have been using Stripe to process payments for my company AstroVenture (see more context in a previous post here ) for a couple of years now, and it has worked great. One thing that took me quite a while to figure out was how to test that we were properly …
This is the fourth and final installment of the series breaking down my talk from DjangoConUS 2022 . The first entry covered background information about the project , the second was about using Django Rest Framework , and the third was about infrastructure and deployment . Before diving in, I'd like to emphasize that …
I recently received an email from Apple stating that they are migrating users from altool to notarytool to notarize applications. Apple says altool will no longer work for notarization starting November 1 2023, but that applications notarized before that will still behave as normal. I previously wrote about notarizing a …
This is the third installment of the series breaking down my talk from DjangoConUS 2022 . The first entry covered background information about the project and the second was about using Django Rest Framework . First, some important context: if you are a devops engineer, or have a lot of experience with …
If you've ended up here from somewhere outside of this blog, and are looking for an exhaustive comparison of these two libraries, I regret to inform you, this isn't that. If you're here for the next installment of the series breaking down my talk from DjangoConUS 2022 , welcome back! This …
In this post, I'd like to provide the context for the project I'm currently writing about on this blog. I'm also using this as an opportunity to start a series of blog posts breaking down my recent talk from DjangoConUS 2022 about what I learned related to Django while building …
So far in my main project (more on that to come), the only users of the admin have been myself and my cofounder, so I've made us both superusers. Recently, I had a request to allow an instructor to view and update data from their own courses. This would require …
And now for something completely different... You may have noticed my favicon is a mug of coffee. I'm a huge coffee fan, and the last few years I've gone further down the rabbit hole with third wave/specialty coffee. I recently bought a new coffee grinder to upgrade from my …
Edit: A lot of the information in this post is still great, but Apple have recently recommended moving from altool (referenced in the linked scripts below) to notarytool , so I have added an update to this post here . For the past few years, Apple's Gatekeeper has made it difficult to …
My current set of tools for deploying my application to production includes Packer and Terraform. I didn't write all of the code for the deployments, but I've been over most of it now. When trying to upgrade my server from Ubuntu 20.01 to 22.01, I ran into some …
This is a short post to tell you to create more bash aliases. I have had one for my devops setup for a while because I have to set several environment variables to get just about anything done. More recently, though, I set up a few more for my main …
There are a few code formatting tools I like to use in just about any Python (and Django) project: black, isort, and flake8. These all serve slightly different purposes, and there are alternatives to each. A full discussion/comparison of code formatting tools in Python is beyond the scope of …
In the time since I've posted on this blog, I've erased the environment I used to set up and run Jekyll. Since I've never been a Ruby programmer and most of the code I write now is in Python, I thought I'd look into a blogging engine in Python. I …
While I was trying to incorporate Stripe’s Javascript library into my codebase, I ran into some issues implementing it in Typescript. I eventually was able to fix those issues, but while I was trying to figure that out, I left the Stripe code as Javascript and stumbled upon an …
I found the documentation for presigned URLS on AWS using boto to be insufficient, so here is how I formed the request. I wanted to have a file private in S3, but expose it to a user for download if they were authorized to access it. I found the easiest …
I originally created this blog using an EC2 instance on AWS and used that to run Jekyll and host the site. Recently, I shut down that instance in order to move the site generation to my local machine(s) and host the site on S3. This article was very helpful …
A website I am currently creating has a very simple front end, but I wanted to be able to swap out instances of my API URLs in TypeScript depending which environment I am working in or building for. So far they are all ‘http://127.0.0.1:8000/’, but …
I am creating a Django application using PostgreSQL (PSQL) for my database and was nearly finished with the API when I discovered some strange behavior. After successfully testing the API in the Django app, I decided to run some basic queries on the database. I received the following error for …
I had a little trouble finding a simple way to set NGINX up to work locally, so I wanted to write up some quick instructions here. I’m using NGINX with Windows Subsystem for Linux (WSL). First, I installed NGINX in WSL with ‘sudo apt-get install nginx’ Then, I created …
For a new project, I wanted to use TypeScript on the front end but not any of the frameworks that usually include it (React, Angular, etc.). Unfortunately, this means that when I have been trying to figure out how to do something in TypeScript, searches often lead me to solutions …
While trying to get more familiar with Django, I started watching talks from DjangoCon from the last few years. I can’t seem to find the talk, but one of them had a list of great Python/Django talks, which inspired me to create me own list (with some definite …
Because I feel much more comfortable in a terminal than on the Windows command line (or in Powershell), I’ve really been enjoying Windows Subsystem for Linux (WSL). In fact, I use it almost exclusively for accessing the server I run this blog from. WSL is essentially a Linux VM …
This week at our local Unity user meetup group, I presented (along with a co-organizer of the group) about Scriptable Objects in Unity. You can find that talk here . This is that same content in text form. Scriptable objects are a powerful tool in designing and developing games in Unity3D …
In addition to starting this blog, I wanted to build some small projects to get some experience with technologies I am not currently using at work. Since I’m currently using Django at work, I decided to create a small Grocery List application using Flask and DynamoDB. You can find …
After setting up my Raspberry Pi as a NAS , I wanted to set up backups that are easy to run and check on. Initially, I wanted to set them up to run automatically, but another goal of the Pi set up was for me to turn my PC off more …
When my external HDD failed, I debated getting a network attached storage device (NAS) before realizing the price wasn’t worth it for me. I don’t have that much data, and really all I wanted was a way to automate backups and have a plex server that requires less …
This week for our local Unity meetup group, I presented an intro to some of the new 2D Tools in Unity (There is an intro about more general Unity topics, so for the 2D stuff skip to 17 minutes in): https://www.youtube.com/watch?v=xopzxmzFJUs Here are the …