Djangocon EU: Django task workers in subinterpreters - Melhin Ahammad

Tags: django, djangocon

(One of my summaries of the 2026 Djangocon EU in Athens).

Full title: Django task workers in subinterpreters: single-server Django applications without process overhead.

He was inspired to tinker with subprocessors by Antony Shaw`s pycon talk

You normally use a wsgi runner like gunicorn to run your django app. There’s also daphne, uvicorn and hypercorn: those also support asgi. If you have tasks, you might use celery , RQ or django-Q (or django-tasks). Instead of a single gunicorn, you then have a broker, a worker and a web server: all deployed separately.

He’s a fan of the fediverse and wanted to run his own server, but he just wanted one program, not three.

You need python 3.14 to actually try some of the stuff he talks about. And you need to have some longer-running tasks in Django.

  • Python 3.14 allows you to run multiple python interpreters in one process. You have separate imports, builtins and separate namespaces per interpreter: isolation. There’s even IPC (inter process communication) via memory. Objects are copied. Subinterpreters handle the GIL by each having their own.

  • Django: preferably 6.0 as you can then use the new Django task framework.

Combining it, you’d use a subinterpreter for the web runner and one or more for the tasks. He hacked a subclass of one of django tasks’ to run something off the queue in a subprocessor.

The demo was the as-you-can-clearly-see version where you have 3 seconds to read 40 lines of logs, so I couldn’t really tell what was happening. It seemed to work :-)

Important note: there are some Python libraries you might use that cannot deal with subprocessors yet, for instance numpy and pydantic. So check that before you start experimenting. If you use pure python + psycopg? Give it a try now. Watch the ecosystem. Subinterpreters unlock a new form of parallelism for deferred workflows.

Here are some more links: https://github.com/melhin/parimitham/blob/main/slides/links.md

https://reinout.vanrees.org/images/2026/moezel6.jpeg

Unrelated photo explanation: a trip in November to the Mosel+Eifel region in Germany. The Mosel river near Bernkastel-Kues, seen from castle Landshut.