| web | http://simonwillison.net/ |
|---|---|
| Author |
April 10, 2025 » Simon Willison's Weblog: django » [Archived Version]
Django: what’s new in 5.2 Adam Johnson provides extremely detailed unofficial annotated release notes for the latest Django. I found his explanation and example of Form BoundField customization particularly useful - here's the new pattern for customizing the class= attribute on the label associated with a CharField: from django import forms class WideLabelBoundField(forms.BoundField): def label_tag(self, contents=None, attrs=None, label_suffix=None): if attrs is None: …
Read MoreApril 2, 2025 » Simon Willison's Weblog: django » [Archived Version]
Composite primary keys in Django Django 5.2 is out today and a big new feature is composite primary keys, which can now be defined like this: class Release(models.Model): pk = models.CompositePrimaryKey( "version", "name" ) version = models.IntegerField() name = models.CharField(max_length=20) They don't yet work with the Django admin or as targets for foreign keys. Other smaller new features include: All ORM models are now automatically imported into ./manage.py shell…
Read MoreMarch 17, 2025 » Simon Willison's Weblog: django » [Archived Version]
suitenumerique/docs New open source (MIT licensed) collaborative text editing web application, similar to Google Docs or Notion, notable because it's a joint effort funded by the French and German governments and "currently onboarding the Netherlands". It's built using Django and React: Docs is built on top of Django Rest Framework, Next.js, BlockNote.js, HocusPocus and Yjs. Deployments currently require Kubernetes, PostgreSQL, memcached, an S3 bucket (or compatible) and an OIDC provider. …
Read MoreMarch 13, 2025 » Simon Willison's Weblog: django » [Archived Version]
Smoke test your Django admin site Justin Duke demonstrates a neat pattern for running simple tests against your internal Django admin site: introspect every admin route via django.urls.get_resolver() and loop through them with @pytest.mark.parametrize to check they all return a 200 HTTP status code. This catches simple mistakes with the admin configuration that trigger exceptions that might otherwise go undetected. I rarely write automated tests against my own admin sites and often feel guilty …
Read MoreDec. 22, 2024 » Simon Willison's Weblog: django » [Archived Version]
I started running a basic link blog on this domain back in November 2003 - publishing links (which I called "blogmarks") with a title, URL, short snippet of commentary and a "via" link where appropriate. So far I've published 7,607 link blog posts and counting. In April of this year I finally upgraded my link blog to support Markdown, allowing me to expand my link blog into something with a lot more room. The way I use my link blog has evolved substantially in the eight months since then. I'm g…
Read MoreNov. 24, 2024 » Simon Willison's Weblog: django » [Archived Version]
Is async Django ready for prime time? Jonathan Adly reports on his experience using Django to build ColiVara, a hosted RAG API that uses ColQwen2 visual embeddings, inspired by the ColPali paper. In a breach of Betteridge's law of headlines the answer to the question posed by this headline is “yes”. We believe async Django is ready for production. In theory, there should be no performance loss when using async Django instead of FastAPI for the same tasks. The ColiVara application is itself op…
Read MoreNov. 13, 2024 » Simon Willison's Weblog: django » [Archived Version]
django-plugin-django-debug-toolbar Tom Viner built a plugin for my DJP Django plugin system that configures the excellent django-debug-toolbar debugging tool. You can see everything it sets up for you in this Python code: it configures installed apps, URL patterns and middleware and sets the INTERNAL_IPS and DEBUG settings. Here are Tom's running notes as he created the plugin. Via @tomviner Tags: djp, django, plugins
Read MoreOct. 20, 2024 » Simon Willison's Weblog: django » [Archived Version]
It feels like we’re at a bit of an inflection point for the Django community. [...] One of the places someone could have the most impact is by serving on the DSF Board. Like the community at large, the DSF is at a transition point: we’re outgrowing the “small nonprofit” status, and have the opportunity to really expand our ambition and reach. In all likelihood, the decisions the Board makes over the next year or two will define our direction and strategy for the next decade. — Jacob Kaplan-Moss…
Read MoreOct. 16, 2024 » Simon Willison's Weblog: django » [Archived Version]
2025 DSF Board Nominations The Django Software Foundation board elections are coming up. There are four positions open, seven directors total. Terms last two years, and the deadline for submitting a nomination is October 25th (the date of the election has not yet been decided). Several community members have shared "DSF initiatives I'd like to see" documents to inspire people who may be considering running for the board: Sarah Boyce (current Django Fellow) wants a marketing strategy, better co…
Read MoreOct. 12, 2024 » Simon Willison's Weblog: django » [Archived Version]
jefftriplett/django-startproject Django's django-admin startproject and startapp commands include a --template option which can be used to specify an alternative template for generating the initial code. Jeff Triplett actively maintains his own template for new projects, which includes the pattern that I personally prefer of keeping settings and URLs in a config/ folder. It also configures the development environment to run using Docker Compose. The latest update adds support for Python 3.13, D…
Read More