4 ms·
Is Django's ORM even supported outside Django sites? I had a consulting gig that had a FastAPI website using Django's ORM and it produced a bunch of weird bug
by Backslasher 1y ago
Is Django's ORM even supported outside Django sites?
I had a consulting gig that had a FastAPI website using Django's ORM and it produced a bunch of weird bugs.
- WhyNotHugo 1y agoThere's nothing forcing you to use the HTTP stack. It's very common for Django applications to also have a Celery worker for async tasks. The Celery worker is a separate process (possible on a separate host) which use the ORM without any of the HTTP portions. You can also write custom standalone scripts which use the ORM. Django has a concept of "management scripts" which are also kinda like that (but with a bit more scaffolding).
- Numerlor 1y agoWe've been running Django's orm under litestar without any issues for maybe 2 years now. We just run django's setup with a minimal settings config as a part of the app startup
- c03 1y ago> outside Django sites What does that mean? Like you can't use the library's ORM without exposing a webserver?
- Backslasher 1y agoMore like "on a long-running process that is not a full-blown Django server"
- fdomingues 1y agoI have made this tiny module to use it wherever I want it. https://github.com/domingues/djangify-package https://github.com/domingues/djangify-package
- x0ff 1y agonice!