Daily Dev Notes 2024/06/02

Still doing nothing else apart from working on pytest. After finally figuring out the issues I was dealing with, I went through all of the tests and standardised my approach to dealing with application settings.

Read more

Posted on Jun 2, 2024 by

Categories: Development

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

Posted on Jun 1, 2024 by

Categories: Development

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

Posted on May 31, 2024 by

Categories: Development

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

Posted on May 30, 2024 by

Categories: Development

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

Posted on May 29, 2024 by

Categories: Development

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

Posted on May 28, 2024 by

Categories: Development

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

Posted on May 27, 2024 by

Categories: Development

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

Posted on May 26, 2024 by

Categories: Development

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

Posted on May 25, 2024 by

Categories: Development

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

Posted on May 25, 2024 by

Categories: General

Day 31 Dev Notes

Just a small change today. I was having so much fun with the Markdown previewer that I add a keyup event so that it became a live previewer, rather than having to press the Preview button.

Read more

Posted on May 24, 2024 by

Categories: Development

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

Posted on May 23, 2024 by

Categories: Development

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

Posted on May 22, 2024 by

Categories: Development

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

Posted on May 21, 2024 by

Categories: Development

Day 27 Dev Notes

Busy night, so not much time to work on DJPress. But to keep my streak going, I updated the requirements for the Bus Times app.

Read more

Posted on May 20, 2024 by

Categories: Development

Day 26 Dev Notes

This was my first attempt at creating a template tag that loops through the categories for a post and returns HTML output. I need to avoid this getting too confusing, but for now you specific if you want the outer tag to be a <ul>, <div>, or a <span>. You can also specify additional classes that get added to the link, which was already in place from the post_category_link tag.

Read more

Posted on May 19, 2024 by

Categories: Development

Day 25 Dev Notes

Added a new post category tonight, along with tests.

Next up, I need to think about looping through categories and how I can create template tags to deal with this.

Read more

Posted on May 18, 2024 by

Categories: Development

LinearMouse

Quick post about this macOS utility called LinearMouse I just discovered. It provides per-mouse configurations and lets me set the scroll direction on the trackpad separately than the scroll direction on the mouse. I'm not sure if I'm a special use-case, but this is the way I like it to be, and for some reason macOS does not let you do this.

Read more

Posted on May 17, 2024 by

Categories: General

Day 24 Dev Notes

More template tags and tests tonight. Not much else going on.

Read more

Posted on May 17, 2024 by

Categories: Development

Day 23 Dev Notes

Once again, my AI friend has helped me out in a really unexpected and amazing way. For the last few nights, I've been adding new template tags to access various elements of the Post. My thinking is that you shouldn't need to know the field names of the model, you should just be able to type {% post_author %} to get the author, or, {% post_date %} to get the date.

But up until now, I thought that the only way I could do this, was to pass the Post object as the parameter so that the template tag knew which post author or date we're wanting. So the code ended up looking this: {% post_author post %} to get the author, or {% post_date post %} to get the date.

Read more

Posted on May 16, 2024 by

Categories: Development

1 3 4