Djangocon EU: when SaaS is not allowed: shipping Django as a desktop app - Jochen Wersdörfer

Tags: django, djangocon

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

He works on “steel-IQ”, an open source modelling platform for steel decarbonisation. They knew that they couldn’t run it as a web app because of strict security requirements at the end users. So they thought about distributing it as a Python library or as jupyter notebooks. But the users would probably mess it up, so an installable UI was needed.

Perhaps we can do it with django? The first working version was easier than expected. They used “Electron” to get an installable app that showed a web interface. You’d start django inside the process, wait until it responded and then show the web interface as usual.

So: electron + django + sqlite.

The actual Steel-IQ app is full of steel terminology. Not everyone has a blast furnace in the back yard, so he created a sample project that’s simpler: https://github.com/ephes/desktop-django-starter

The components:

  • Electron: main.js nodejs program.

  • Django server.

  • BrowserWindow: a chromium renderer, this is what the user sees.

  • Django workers: for the background simulation work.

  • Shared data layer: sqlite + filesystem. The sqlite database is also used by the DatabaseBackend of django-tasks. This means you can run background tasks without needing rabbitmq processes or so. Handy!

Some security measures:

  • Django listens on 127.0.0.1 on a random port. So it doesn’t connect to any external network interfaces.

  • Django still validates requests (csrf, ALLOWED_HOSTS).

  • Electron page stays unpriviliged: no node, no filesystem access.

Packaging was a bit tricky. There’s quite a lot: electron+Chromium, standalone Python, Python dependencies via uv, Django apps + assets. They build the package in CI. Writable data lives outside the app bundle. DMG for mac, windows installer for windows, tgz for linux.

He demoed it. Worked fine. Even with a live “check for upgrades” that installed a new version.

When you think about making a desktop app from your Django website, many things like templates models and static files stay the same. Authentication changes, of course. You need desktop-specific settings. Ensure writeable paths for logs, media files, etc.

Electron is not the only toolkit you can use. Tauri is an alternative that looks nicer (he discovered it too late). For a simpler Python-first desktop wrapper: look at pywebview/positron. If mobile is required, a mobile web or even native toolkit is the best. If you need native widgets, look at QT/PySide, Kivy, BeeWare/Toga.

Note: there was a similar talk in 2015 in Cardiff: https://reinout.vanrees.org/weblog/2015/06/02/09-django-desktop.html

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

Unrelated photo explanation: a trip in November to the Mosel+Eifel region in Germany. Sunset over the Mosel valley, seen from the “Mont Royal” fortifications build by the French king Louis XIV.