Tweets & Toots.
“#django” 1 à 10 sur 31
- RT @adamghill "The on-demand fetching behavior of model fields is now configurable with fetch modes. These modes allow you to control how Django fetches data from the database when an unfetched field is accessed." https://docs.djangoproject.com/en/dev/releases/6.1/#model-field-fetch-modes #django 24/05/2026 à 17:53 Permalien
-
#django tracks all queries in the connection object only if `DEBUG=True`.
This is sometimes the exact thing you want in tests.
But tests are always executed with `DEBUG=False` https://docs.djangoproject.com/es/5.2//topics/testing/overview/#other-test-conditions
An option is to use `CaptureQueriesContext` to temporarily enable query tracking on a connection https://stackoverflow.com/a/60299392 17/07/2025 à 15:49 Permalien -
RT @be_haki Just published "How to Get Foreign Keys Horribly Wrong" in #django
https://hakibenita.com/django-foreign-keys
Finally got around to publishing the article that inspired my talk in DjangoCon. If you already watched / attended the talk make sure to check out that last part about `FOR UPDATE NOT KEY`. 15/07/2025 à 19:40 Permalien - RT @jacob Twenty years ago today we released the little web framework we’d developed at the Lawrence Journal-World to help us build news sites and apps. We hoped maybe a couple of other media outlets, and maybe a few in the Python community, might find it useful. Never in a million years could I have predicted what happened next… #django #history https://www.djangoproject.com/weblog/2025/jul/13/happy-20th-birthday-django/ 14/07/2025 à 07:15 Permalien
- I definitely need to try serving #django with Caddy instead of #nginx https://tfeldmann.de/blog/serving-django-with-caddy/ 19/05/2025 à 13:59 Permalien
-
Composite Primary Keys is a great new feature in #django 5.2 https://docs.djangoproject.com/en/5.2/releases/5.2/#composite-primary-keys
Some people have been waiting a long time for this ;) 03/04/2025 à 12:33 Permalien -
TIL django-filter has a built-in `CSVWidget` for comma-separated values.
It can be used with `AllValuesMultipleFilter` and will trigger a `distinct` SQL query to validate that each ID really exists:
```
ids = AllValuesMultipleFilter(field_name="id", widget=CSVWidget)
```
`BaseInFilter` can be used to avoid the `distinct` query:
```
class NumberInFilter(django_filters.BaseInFilter, django_filters.NumberFilter):
pass
ids = NumberInFilter(field_name="id", widget=CSVWidget)
```
https://github.com/carltongibson/django-filter/issues/727 #django 24/03/2025 à 16:19 Permalien - Like a good old friend: `./manage.py debugsqlshell` https://django-debug-toolbar.readthedocs.io/en/stable/commands.html #django 30/12/2024 à 21:03 Permalien
- RT @adamchainz Fast and slow ways to rotate your #django secret key https://adamj.eu/tech/2024/08/30/django-rotate-secret-key/ 31/08/2024 à 06:56 Permalien
-
Cool guide to using the #django system checks framework.
I also like this convention based on English grammar rules:
- DateTimeField fields' names should end with `_at`
- DateField fields' names should end with `_on` (or `_date` where `_on` is unnatural)
RT @spookylukey New blog post: https://lukeplant.me.uk/blog/posts/enforcing-conventions-in-django-projects-with-introspection/ 04/04/2024 à 15:10 Permalien