It's something that's been on the back of my mind for a few years now, but your daily blogging in February really motivated me to actually start doing it.
The computer is use daily is a ~7 year old laptop with a somewhat small SSD. I'm not very good at pruning docker images, so I've been routinely low on storage space.
Well today I completely ran out. The reason? I was running the build script for a PaaS command-line tool and it consumed over 4Gb of storage space.
4Gb. For a CLI tool.
Makes me wonder if there are many examples of this in Django's history. Migrations and JSON fields come to mind, but that's about it.
As a user, one criteria I'd have would be seamless integration once the package gets merged in to core. Ideally I could just switch the import path and be done with it.
RSS is amazing! But do you know what is even better? RSS feeds that can be rendered by a browser and explain to a user the concept of #RSS.
@darekkay wrote a really nice blog post on how to do that and I adapted it for a #Django project i am working on. Even if you are not interested in Django it might be an interesting introduction and I highly recommend checking out the examples and Darek's blog post.
I've recently picked up the habit of asking LLMs a variant of "Is that feature you just told me about real?" immediately after answers that seem too good to be true.
A bit more than half the time my suspicion holds.
"I apologize. I apparently confabulated again."
/cc @driscollis we were just talking about this today.
Python folks: in random.choices, does it always return the k value of choices? ie.
names = random.choices(names_list, k=20)
It would return 20 random names from names_list (including duplicates). What if there's not enough names in names_list?
I have some code that regularly returns less. I'm trying to determine if it's a Django problem. Similar (non-Django) code doesn't have this issue, hence my confusion.
@skribe according to the docs, random.choices is with replacement, which should mean you'll always get k elements, possibly with duplicates (or guaranteed duplicates if k>len(choices) )
Or if choices is empty, you'll get an exception (IndexError)
@nanorepublica At my previous job I hacked together a script that would git grep all the url names defined in the project and warn if one wasn't being used anywhere.
It was very hacky but it did catch several unused views.
One major hurdle I found with this type of check is that there's no API for listing templates (as far as I know). That made it hard to build tools that would scan all templates in a project.
@carlton@nanorepublica that only works for the filesystem loader though (which is what almost every one uses, I admit). There's no official api for it (one that would take into account template overloading for example)