@adamchainz@fosstodon.org
@adamchainz@fosstodon.org avatar

adamchainz

@adamchainz@fosstodon.org

:django: #Django technical board member
🍕 London Django Meetup Organizer with https://fosstodon.org/@cgl
✍️ Author of three books on Django and Git
🇬🇧 London / 🇵🇹 Lisbon

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

bbelderbos, to github
@bbelderbos@fosstodon.org avatar

🚀 Quickly jump from your local repository to its corresponding GitHub page with this handy shell alias! ✨

🔗 Add openrepo to your shell profile or rc file, source it, and now you can simply type openrepo in your terminal to open your GitHub repo. 😎

adamchainz,
@adamchainz@fosstodon.org avatar

@bbelderbos GitHub CLI: gh repo view --web

Also has jump to the PR for the current branch: gh pr view --web

danielfeldroy, to random
@danielfeldroy@fosstodon.org avatar

Hello LaTeX, good to see you again.

adamchainz,
@adamchainz@fosstodon.org avatar

@danielfeldroy ✍️✏️🚀

adamchainz, to python
@adamchainz@fosstodon.org avatar

A pattern I’ve recently enjoyed using:

  1. Change some function in a way that needs fixes to call sites.
  2. Run the whole test suite with pytest.
  3. Copy the list of failing test IDs from pytest’s summary into a scratch file.
  4. Fix up the found callers.
  5. Verify everything fixed by saving the list of tests with: pytest $(cat scratch/testids.txt)

adamchainz,
@adamchainz@fosstodon.org avatar

@watte Yes, and allowing partial test runs in step four whilst fixing up certain callers.

Edent, to random
@Edent@mastodon.social avatar

What's the lowest amount you've paid for something using a credit card?

Went to the market the other day and paid for a £2 punnet of fruit using a credit card. Guy was running Square on his phone, showed me the screen, I tapped, done.

I remember when everyone was £10 minimum for card payments, even in large shops. Now sole-traders can take instant payment for low value amounts. Brilliant!

adamchainz,
@adamchainz@fosstodon.org avatar

@Edent I regularly go in Tesco and buy a single banana for my toddler at 27p.

adamchainz,
@adamchainz@fosstodon.org avatar

@OliverC @alexhern @Edent This is a small local supermarket, they’re cheaper in larger ones. I always thought produce was more expensive in the US, I saw broccoli at $5 in a large supermarket, some years ago.

adamchainz,
@adamchainz@fosstodon.org avatar

@Edent @alexhern we are all apes here

circumeo, to django
@circumeo@mastodon.social avatar

Trying to upload a directory and use webkitRelativePath to preserve the local path in a #django app, and it seems like that might not be so easy.

I've tried a custom upload handler, but even there, Django seems to have already stripped the path.

adamchainz,
@adamchainz@fosstodon.org avatar

@circumeo Did you get any further? Sounds like an interesting feature to support, though we’d probably wait for the cross-browser spec to add it to Django itself.

adamchainz,
@adamchainz@fosstodon.org avatar

@circumeo Ah, looking at the docs, this is an HTML input property, only: https://developer.mozilla.org/en-US/docs/Web/API/File/webkitRelativePath . I think Django isn’t stripping the path, it’s just not sent by the browser. I think you need to use JavaScript to put the values into some form field if you want to send them to the server.

adamchainz,
@adamchainz@fosstodon.org avatar

@circumeo Ah I see. It is probably up in the WSGI later, and may even be a recommended step in HTTP or WSGI servers. Deserves more research.

SebastianM6L, to django
@SebastianM6L@mastodon.social avatar

Any cracks here who can explain me why when I run my tests with the django built in manage.py test (runs unittest) I have 51 tests run.

When I run them with pytest It will only run 38 tests.

adamchainz,
@adamchainz@fosstodon.org avatar
adamchainz, to random
@adamchainz@fosstodon.org avatar

Just blocked a bunch more AI bots in my site’s robots.txt, thanks to this post from @cory:

https://coryd.dev/posts/2024/go-ahead-and-block-ai-web-crawlers/

adamchainz,
@adamchainz@fosstodon.org avatar

@cory A recent post that further convinced me LLMs mostly rehash content from the web: https://lcamtuf.substack.com/p/large-language-models-and-plagiarism

adamchainz,
@adamchainz@fosstodon.org avatar

@cory great!

bmispelon, to random
@bmispelon@mastodon.social avatar

I'm really enjoying this post by @capjamesg about fun things you can do on your personal website: https://jamesg.blog/2024/02/19/personal-website-ideas/

After many years of thinking about it, I finally created my own site 2 months ago and it's been a lot of fun. I'd definitely recommend it!

adamchainz,
@adamchainz@fosstodon.org avatar

@bmispelon Great list, and I’m loving your site 👏

adamchainz, to django
@adamchainz@fosstodon.org avatar

🆙 django-upgrade 1.17.0 is out, with new options to select which fixers run: --only, --skip, and --list-fixers.

🙏 Thanks to Gav O'Connor for the PR, and @davidszotten for initial work.

https://github.com/adamchainz/django-upgrade

adamchainz, to python
@adamchainz@fosstodon.org avatar

✍️ New post covering a small helper to return all subclasses of a given class.

https://adamj.eu/tech/2024/05/10/python-all-subclasses/

adamchainz,
@adamchainz@fosstodon.org avatar

@anze3db love a good yield from 😇

henryiii, to python
@henryiii@fosstodon.org avatar

This feature of uv is not talked about enough:

uv pip install --exclude-newer 2020-01-01 -r requirements.txt

I was able to recover and build a project untouched for many years using this easily!

adamchainz,
@adamchainz@fosstodon.org avatar

@henryiii very nice. I once resurrected a project with unpinned requirements by checking PyPi for each package to find the version at the time… so nice to have a tool that can do it now.

mariatta, to random
@mariatta@fosstodon.org avatar
adamchainz,
@adamchainz@fosstodon.org avatar

@mariatta Everything is good apart from the webcam wobble, which I find a bit dizzying.

adamchainz,
@adamchainz@fosstodon.org avatar

@mariatta Yeah that’s an easy solution. I had the same problem too when recording from my laptop camera, as my gestures would make the desk wobble the laptop. I now use a separate tripod stand with ring light that doesn’t tend to wobble.

adamchainz, to django
@adamchainz@fosstodon.org avatar

✍️ New post on my new package django-harlequin.

🦆 This package provides a small launcher command for Harlequin, the Terminal-based SQL IDE by Ted Conbeer.

💽 Try it out and let me know what you think!

#Django #SQL

https://adamj.eu/tech/2024/05/07/django-harlequin/

adamchainz,
@adamchainz@fosstodon.org avatar

@e11bits The lack of dependency was an oversight that I just released a fixed version for.

Yeah, it’s a bit heavy, maybe that could be worked on upstream.

adamchainz,
@adamchainz@fosstodon.org avatar

@benjaoming Yeah it has a lot of unnecessary upper version bounds... Maybe it would be better to not have it as a dependency, allowing pipx installs etc. I think I will roll that back, later.

adamchainz,
@adamchainz@fosstodon.org avatar

@e11bits Oh, cool. Publish as django-pgmacs!

adamchainz,
@adamchainz@fosstodon.org avatar

@benjaoming Thank you for helping make it better! I just merged your PR and released a version with the dependency removed.

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