Can a Django project be turned into a desktop application and distributed?
If by “Desktop application” you mean that you install and run the web server and other necessary components on your PC, and then access it using your browser, then yes, that could be done.
Otherwise, no.
Thanks KenWhitesell for your response. I meant whether I can package the django project that runs in a desktop app window using the browser and be able to distribute it as an executable on another device without the need to install Python and Django.
Yes you can but not directly through django ! You can make use of pyinstaller library to convert your python code into an executable
This will eliminate the need for django to be installed in user’s desktop but there is an issue, it will still run in the browser and not as a separate gui ( exe will open it in browser cause it’s django)
If you want to stick to application as in gui, you can explore the flet library in python where you can use both together
No you really can’t. You’re going to run into issues with configurations in your settings files, and any ancillary processes that you may need to run.
Feel free to try it, but if you search the forum, you’ll find about a half-dozen other people who have also tried it and no one has reported success.
Thanks Ken for the information.
Thanks Yogya for the reply.
Do check out @freakboy3742’s BeeWare project!
It has a “Positron” template, that creates an Electron-like desktop app, wrapping your web application (which can be Django) and then provides a web view in a window as the UI for that. (So just like Electron, but in Python.)
There were some very recent changes announced here, so you may need to explore a bit to find the most up to date starting point. The project is excellent though, and does provide the tooling to package as a desktop app.
Thanks Carlton, I would check out the beware project.
For those interested - the Positron README is the best place to start - it gives you a summary of how to build your first Positron Django app.
The underlying capability to do this has existed in Toga for a while; this plugin for Briefcase makes it a lot easier to get started. If you hit any problems, let us know!