@bmispelon@mastodon.social
@bmispelon@mastodon.social avatar

bmispelon

@bmispelon@mastodon.social

💩🔥💻

This profile is from a federated server and may be incomplete. Browse more on the original instance.

bmispelon, to django
@bmispelon@mastodon.social avatar
bmispelon,
@bmispelon@mastodon.social avatar

@webology Thanks!

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.

So really you only have yourself to blame 😁

nanorepublica, to django
@nanorepublica@indiehackers.social avatar

📣 Native Django alerting package - Responses
📄 Responses to yesterday's post
🔗 https://softwarecrafts.co.uk/100-words/day-80
#100_words,#django,#package,#idea-response

bmispelon,
@bmispelon@mastodon.social avatar

@nanorepublica Neat idea to do a writeup of the responses like that, thanks for taking the time 👍

May I suggest adding a link to the writeup from the original post?

bmispelon, to random
@bmispelon@mastodon.social avatar

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.

What a tech world we made 💩🔥💻

felixxm, to django
@felixxm@fosstodon.org avatar

A month ago, after 5 years of service, I stepped down from the Django Fellowship 💔 💚 I decided to share some raw stats 📊:

Triaged: 3️⃣8️⃣3️⃣4️⃣ 🎫
Reviewed/committed: 3️⃣0️⃣6️⃣7️⃣ PR
Authored: 8️⃣0️⃣7️⃣ PR
Releases issued: 9️⃣2️⃣ 📦

bmispelon,
@bmispelon@mastodon.social avatar

@felixxm What an amazing trac(k) record 🤩

bmispelon, to django
@bmispelon@mastodon.social avatar
bmispelon,
@bmispelon@mastodon.social avatar

@carlton What if we renamed it "djangocon"? 🙃

bmispelon,
@bmispelon@mastodon.social avatar

@adamchainz Now i just need to wait for a release (and to change @carlton 's mind about converting Django's docs) 😁

bmispelon,
@bmispelon@mastodon.social avatar
webology, to random
@webology@mastodon.social avatar

🎉 I had a client meeting postponed until next week at their request, so I have an unexpected free afternoon now.

🕰️ I am going to start Office Hours 30 minutes early and catch up on all the things this afternoon leading up.

I look forward to seeing the regulars and new faces. We had four or five new faces over the last few weeks. https://mastodon.social/@webology/112329125913670748

bmispelon,
@bmispelon@mastodon.social avatar

@webology I don't know if I misunderstood the timezone, but I can't seem to join.

nanorepublica, to django
@nanorepublica@indiehackers.social avatar

📣 Merging a third party package into django core
📄 Question: What would a package look like if it's goal was to be merged into Django core?
🔗 https://softwarecrafts.co.uk/100-words//100-words/day-78
#100_words,#django,#packages,#merging

bmispelon,
@bmispelon@mastodon.social avatar

@nanorepublica looks like the link is broken fyi (returns a 404 for me)

bmispelon,
@bmispelon@mastodon.social avatar

@nanorepublica Very interesting read, thanks.

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.

carlton, to random
@carlton@fosstodon.org avatar

The pre-conf for #djangoconeurope in Madrid the Monday night seems to be shaping up nicely, if you’re still making plans 😉

🚞 to Vigo Tuesday morning

bmispelon,
@bmispelon@mastodon.social avatar

@adamchainz I'm langing at OPO on Monday (3rd) at 19:30 (local time I think). I'd love to meet up if you're up for it.

bmispelon, to random
@bmispelon@mastodon.social avatar

New blog post: A programming joke, etymology, and the challenges with naming things.

https://blog.bmispelon.rocks/articles/2024/2024-04-18-etymology-naming-things-off-by-one-error.html

Warning: may contain traces of Python, Django and some Latin ⚠️

moanos, to RSS
@moanos@gay-pirate-assassins.de avatar

New blog post: Styling an Django RSS Feed.

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.

https://hyteck.de/post/django-rss/

bmispelon,
@bmispelon@mastodon.social avatar

@moanos You can use handler.processingInstruction() to add the stylesheet (no need for a custom _write() method):

class FeedWithStylesheet(Rss201rev2Feed):
def add_root_elements(self, handler):
handler.processingInstruction("xml-stylesheet", 'href="/static/rss.xsl" type="text/xsl"')
super().add_root_elements(handler)

https://docs.python.org/3/library/xml.sax.handler.html#xml.sax.handler.ContentHandler.processingInstruction

Thanks for sharing this technique, it looks really neat!

treyhunner, (edited ) to llm
@treyhunner@mastodon.social avatar

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.

#llm #claude

bmispelon,
@bmispelon@mastodon.social avatar

@treyhunner Have you also experienced the LLM "hallucinating" an apology where it turns out it's actually correct?

I would (maybe naively?) expect those to happen as well but I don't use LLMs enough to know.

skribe, to python
@skribe@aus.social avatar

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.

#python #Django

bmispelon,
@bmispelon@mastodon.social avatar

@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)

bmispelon,
@bmispelon@mastodon.social avatar

@skribe (the random module is written in Python, so you can check how random.choices is implemented: https://github.com/python/cpython/blob/3.12/Lib/random.py#L454).

Which Django code are you using that returns less choices?

bmispelon,
@bmispelon@mastodon.social avatar

@skribe that is weird indeed 🤔

benjaoming, to random Danish
@benjaoming@social.data.coop avatar
bmispelon,
@bmispelon@mastodon.social avatar

@benjaoming Alltid gøy med kontronymer 😁 https://en.wikipedia.org/wiki/Contronym

nanorepublica, to random
@nanorepublica@indiehackers.social avatar

📣 Analysis for unused code in a Django codebase
📄 An idea I wish existed and I hope to build one day
🔗 https://softwarecrafts.co.uk/100-words/day-71

bmispelon,
@bmispelon@mastodon.social avatar

@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.

bmispelon,
@bmispelon@mastodon.social avatar

@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)

bmispelon,
@bmispelon@mastodon.social avatar

@carlton @nanorepublica yep, that's what I meant.

It won't be me either, I know better now 😁

bmispelon, to django
@bmispelon@mastodon.social avatar

I just discovered that the #Django runserver command can be optimized to run better in colder climates by using a special flag:

python manage.py runserver --ski

⛷️ 🏔️ ❄️

I wonder if there are also secret optimizations for warmer climates 🤔

bmispelon,
@bmispelon@mastodon.social avatar

@webology It's actually the showmigrations command that has a flag to honor the many Polish contributors:

python manage.py showmigrations --pl

🙃

bmispelon,
@bmispelon@mastodon.social avatar

@webology Meanwhile, the check command can give you a warning if your project contains too many german words:

python manage.py check --de

/cc @markush

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • mdbf
  • ngwrru68w68
  • tester
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • megavids
  • tacticalgear
  • osvaldo12
  • normalnudes
  • cubers
  • cisconetworking
  • everett
  • GTA5RPClips
  • ethstaker
  • Leos
  • provamag3
  • anitta
  • modclub
  • lostlight
  • All magazines