Djangocon EU: SaaS가 허용되지 않는 경우: Django를 데스크톱 앱으로 배송

hackernews | | 📰 뉴스
#django #djangocon eu #open source #saas #데스크톱 앱 #desktop app
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

강철 탈탄소화 모델링 플랫폼 'Steel-IQ'를 개발한 Jochen Wersdörfer는 최종 사용자의 엄격한 보안 요건으로 인해 SaaS 방식이 불가능하자 Electron과 Django, SQLite를 결합하여 데스크톱 애플리케이션으로 배포하는 방법을 소개했다. Electron의 Chromium 렌더러로 로컬에서 Django 서버를 실행하되 127.0.0.1의 랜덤 포트에서만 동작시키고 CSRF와 ALLOWED_HOSTS 등 Django 보안 검증을 유지하며, Electron 프로세스에는 노드나 파일시스템 접근 권한을 부여하지 않는 방식으로 안전하게 구현했다. 공개된 샘플 프로젝트(desktop-django-starter)를 통해 누구나 쉽게 유사한 구조를 구축할 수 있으며, mac용 DMG, Windows용 인스톨러, Linux용 tgz 패키지로 빌드 가능하고 자동 업그레이드 기능도 지원하는 것이 특징이다.

본문

Djangocon EU: when SaaS is not allowed: shipping Django as a desktop app - Jochen Wersdörfer¶ (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 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.

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →