Daily Dev Notes 2024/06/08

Still working on the template tags for DJ Press. I realised that in taking inspiration from WordPress, I'm unnecessarily complicating things in the templates. So I'm now moving some of the logic back to the views in order to simplify things.

Read more...

Daily Dev Notes 2024/06/03

Finally got to 100% test coverage! This has been a great experience and I've learned so much about testing by divining into some gnarly edge-cases. It's also told me that even the bits of code that I thought I was properly testing, needed further tests to fully cover the edge-cases.

Read more...

Daily Dev Notes 2024/06/01

More testing, testing, testing...

I've been really focusing on the bit of code I've got for getting and setting application-level settings. While the code itself seemed fine, I was running into all sorts of weird bugs when running my tests.

Read more...

Daily Dev Notes 2024/05/31

No real coding today, but did tidy up some infrastructure issues at home. I had been trying out GlichTip, which is a self-hosted Sentry alternative. I hadn't been super happy with it, but was giving it some time to collect some stats before making a decision on it.

Read more...

Daily Dev Notes 2024/05/30

Testing, testing, testing...

Been spending some time catching up on testing. Decided to try out Coverage for the first time, and this has been an interesting experience. I already had pretty test coverage, but Coverage pointed out some edge cases that I had missed. And while I was trying to test out these edge cases, I discovered some bugs.

Read more...

Daily Dev Notes 2024/05/29

Last week I implemented a Markdown Previewer using HTMX, which was fairly rudimentary - it just POSTed the contents of a textarea element to a Django view that returned the converted content, which HTMX swapped into the preview div element.

While this worked pretty well, I wasn't overly keen of the constant stream of POST requests that were being streamed to the server. I had played with some different delays to reduce the number of requests - but the higher the delay, the less interactive it felt. I also didn't want to implement a client-side markdown renderer with JavaScript, because I wanted to use the same renderer in the previewer that I'm using on this site.

Read more...

Daily Dev Notes 2024/05/28

Finally starting to feel like I'm getting on top of this package publishing business. Yesterday I managed to get a project structure more or less sorted out, which also let me run proper linting, formatting, and tests.

Today I focused on implementing GitHub Actions workflows so that the full test suite runs on commit, and new packages are built and uploaded to PyPi!

Read more...

Daily Dev Notes 2024/05/27

A lot of restructuring the DJ Press code base tonight, but I think I've got it into shape now. I can finally run my tests, and in doing so found some bugs that had crept in. I've also got my pre-commit hooks all updated and working again, which also meant that I got to clean up some mess that had crept in.

Read more...

Daily Dev Notes 2024/05/26

Made some minor tweaks to the categories tags today. But that was a quick and easy change.

The main thing I need to focus on now, is a better workflow to work on this package. I'm still not sure how to test this package since it requires a Django site to test, and that's not included in the package for obvious reasons. Not sure how best to do this, but will do some digging because this must be a solved problem given the sheer number of Django packages available.

Read more...

Daily Dev Notes 2024/05/25

I took the plunge today and finally ripped out djpress into its own, stand-alone package. I mostly followed this guide from Django, which linked through to a tutorial on the Python Packaging site which explained how to build and upload it.

After following the steps, I managed to get the package deployed to PyPi, and created a new public repository to host the code!

Read more...

Achievment Unlocked

I started this blog 31 days ago with the aim of committing code and blogging about it every day for a month. I've achieved that goal, and am now feeling more energised than ever to keep this going.

The main reason I did this was that I was stuck on a gnarly re-write of DJ Checkup and I couldn't get motivated to keep working on it. Then, I picked up James Clear's book Atomic Habits, and he talks a lot about starting small habits. So that was the idea: commit at least once per day, and blog about it.

Read more...

Day 30 Dev Notes

I did some searching online today, looking for a Markdown editor that I could easily embed in a page, so that I could provide a better editing experience for posts. But while I was searching, I had an idea - what if I just built a Markdown previewer alongside a regular textarea element.

So I gave it a quick go, and it worked!

Read more...

Day 29 Dev Notes

Had some fun this evening. I installed a self-hosted error-tracking application called GlitchTip. It's written in Python and Django and is compatible with Sentry - in fact, to integrate the error reporting into your app, you install the Sentry SDK and configure the DSN to a GlitchTip-specific URL for your own installation.

Installation was fairly straight forward. The Docker compose file they provided was easy to modify for Portainer, but there were a couple of undocumented settings that I had to figure out along the way. But once it was up and running, it was easy to set up the projects and get the client reporting errors.

Read more...

Day 28 Dev Notes

After yesterday's success updating requirements for Bus Times, I decided to do the same with the Amanzi website. This is an extremely simple Django site that serves a single static template from a view. No admin, or authentication, or databases required.

Should have been a simple update, but I decided to take this opportunity to also modernise the code base a bit by adding the pre-commit hooks I've been using on other projects. Which, of course, meant ensuring that everything was nicely formatted with Ruff. And then I noticed that the Whitenoise configuration was a bit out of date too, along with the Docker configuration too...

Read more...

1 3 4