@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

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
bmispelon, to CSS
@bmispelon@mastodon.social avatar

New article this week: A #CSS technique for making desaturated background images: https://blog.bmispelon.rocks/articles/2024/2024-04-12-css-desaturated-background-image.html

kfdm, to django
@kfdm@social.tsun.co avatar

Working with and I'm using custom tokens so that VueJS and Django tokens don't conflict, but I also have a need to escape to ensure users can't get my VueJS delimiters anywhere.
Is there a place I can hook in to add my own, additional escape code 🤔, or am I doomed to have to add {{value|myescape}} everywhere a value is used 😢

bmispelon,
@bmispelon@mastodon.social avatar

@kfdm it might not be what you're after, but if you can control the value that gets passed to the context, you should be able to implement a custom html() method and Django should honor that when outputting the value in the template.

bmispelon,
@bmispelon@mastodon.social avatar

@kfdm If you do write up something please let me know, it sounds like an intriguing problem (for one thing, I would not expect a modelform with failed validation to change anything on its instance, but I might very much be wrong)

carlton, (edited ) to random
@carlton@fosstodon.org avatar

The coffee must be good this morning.

Just drafting some thoughts about #AlpineJS and « ”I’m just going to write my own”, is the battle-cry of morons » gently flows from the fingers. ☕️

May have to copy-edit 🤔

bmispelon,
@bmispelon@mastodon.social avatar

@carlton Very much in agreement on the idea, but I'm personally not a big fan of the word "moron". It's got quite a violent history and meaning if you ask me. If you're open to suggestions, how about "fools"?

daniel, to random German
@daniel@social.telemetrydeck.com avatar

Buglur

bmispelon,
@bmispelon@mastodon.social avatar

@daniel 99 garms of buglur to be exatc

bmispelon,
@bmispelon@mastodon.social avatar

@daniel everythnig tastes better in quantities of nine and ninety 🎈

bmispelon, to django
@bmispelon@mastodon.social avatar

Just published a new article on trying to find the best way to initialize Sentry in a #Django project: https://blog.bmispelon.rocks/articles/2024/2024-04-06-sentry-initialization-in-a-django-project.html

webology, to random
@webology@mastodon.social avatar

👀 So it's a rare Saturday when I'm working because I shifted my week to take a Monday off, and I'm getting logged out of the Django Admin (localhost + Django 5.0.4) every ~5 seconds.

My console shows:

> django.security.SuspiciousSession WARNING Session data corrupted

This issue seemed to go away after I re-ran collectstatic to fix a few broken images. (It already gets ran at least twice).

🤔 I am not sure if this is a new Django bug or if anyone else is seeing this?

bmispelon,
@bmispelon@mastodon.social avatar

@webology That looks like a fun bug to track down 😁

Could it be you have some kind of in-memory session storage that gets wiped out on reload?

webology, to random
@webology@mastodon.social avatar

⛳ Syncing Django Waffle feature flags: https://micro.webology.dev/2024/04/05/syncing-django-waffle.html

bmispelon,
@bmispelon@mastodon.social avatar

@webology looks like something wonky happened in the code sample with the @ click decoration

bmispelon, to python
@bmispelon@mastodon.social avatar

I made a #python poetry bot: @unicodedatapoetry and wrote about it on my blog: https://blog.bmispelon.rocks/articles/2024/2024-03-27-unicode-poetry-bot.html (oh yeah, I have a blog now apparently)

mahryekuh, to random
@mahryekuh@fosstodon.org avatar

My partner asked me to look into Caddy to create pretty URLs for localhost projects on macOS.

I found a workable setup and wrote an article about it:

"Custom localhost URLs with Caddyfile on macOS"

https://marijkeluttekes.dev/blog/articles/2024/03/25/custom-localhost-urls-with-caddyfile-on-macos/

bmispelon,
@bmispelon@mastodon.social avatar

@mahryekuh Oh this is a super neat idea. I never thought of running a local proxy for this.

And I'm guessing you get https automatically with this setup?

Thanks for sharing!

_chrismay, to django
@_chrismay@fosstodon.org avatar

friends, I have a surprisingly thorny issue.

A user has been uploading very large files that time out or run the system out of memory.

I created a way for their browser to upload the files straight into the cloud, but now I can't figure out how to save the model's FileField.

bmispelon,
@bmispelon@mastodon.social avatar

@_chrismay I would assume the cloud provider lets you pass a callback URL when you upload the file. Then you can update your model's filefield in that view.

bmispelon, to django
@bmispelon@mastodon.social avatar

Just spent an hour of my morning trying to debug why my queryset annotation wasn't working.
Turns out I'd written "fist_name" instead of "first_name" and the error message had been telling me all along but my eyes glossed over it 👊🏻

#django

bmispelon, to random
@bmispelon@mastodon.social avatar

@apollo13 Hi Florian! After a few weeks of work, we've finally upgrade to Python3 on code.djangoproject.com 🎉

Do you have any tips on how I could test if https://github.com/django/code.djangoproject.com/blob/main/DjangoPlugin/tracdjangoplugin/wsgi.py#L11-L13 is still needed?

Thanks!

bmispelon,
@bmispelon@mastodon.social avatar

@apollo13 We're Python 3.8 for now, but 3.11 is on the roadmap soon hopefully.

Did you ever manage to reproduce the issue locally, or is this all in prod? (we do have Sentry but I'd rather be able to at least get a sense of things locally before we roll things out)

bmispelon,
@bmispelon@mastodon.social avatar

@apollo13 I'm a bit out of my depth here, can you clarify what you mean by "instrument[ing] the code" and by "high file limit"?

bmispelon,
@bmispelon@mastodon.social avatar

@apollo13 Thanks a lot, that seems like it should be enough to get me started 👍

bmispelon,
@bmispelon@mastodon.social avatar

@apollo13 Thanks, I probably will 😁

nanorepublica, to django
@nanorepublica@indiehackers.social avatar

history question for the community.

What other use cases were considered to live under the management directory apart from commands?

Going 2 levels deep has always seemed an odd quirk to me, therefore I assume it's 2 levels for other functionality besides commands to exist there.

bmispelon,
@bmispelon@mastodon.social avatar

@nanorepublica I've always wondered this too!

mahryekuh, to random
@mahryekuh@fosstodon.org avatar

Super useful talk about Git, from Scott Chacon at FOSDEM 2024:

https://www.youtube.com/watch?v=aolI_Rz0ZqY

bmispelon,
@bmispelon@mastodon.social avatar

@mahryekuh That "includeIf" trick was excellent, thanks again for sharing! 👍

bmispelon, to django
@bmispelon@mastodon.social avatar

django.db.utils.OperationalError: generated columns cannot be part of the PRIMARY KEY

Oh come one, I really thought that one was going to work (interesting that Django was happy to generate the migration but only failed when trying to apply it) 🤔

bmispelon,
@bmispelon@mastodon.social avatar

@shaib Isn't the virtual-ness controlled by the db_persist kwarg? The field should have enough information to yell at me at instanciation time, no?

Good point about the backend though. The exception is indeed raised in the db backend (sqlite in this case). I should try to see if postgres behaves different.

bmispelon, to random
@bmispelon@mastodon.social avatar

@carlton re your earlier comment on my PR, could you elaborate on what you think would make for an interesting talk?

I have the impression that very few people actually use Django the way we use it on code.djangoproject.com (for good reasons), don't you agree?

bmispelon,
@bmispelon@mastodon.social avatar

@markwalker Never heard of stackable models before, what are those?

If you;re curious (there's no that much to it really) the PR that started this thread is here: https://github.com/django/code.djangoproject.com/pull/176

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