I was looking at this older post Wrapping Dash applications for desktop use and wanted to know if there have been any updates to the question of whether a person can create a dash app that runs in Electron.
Ideally, I would like to not run dash on any of the user’s ports (so you can’t go to, say 8070 and see the app running there in the browser, for instance).
I got the high level overview of one of the answers, but wanted specifics on what keywords or concepts I can search for to start running Dash in an Electron.js app, such that the server with the Dash app feeds directly to the Electron app.
Thanks!
Hello, I have developed and wrapped a dash app for distribution, in a similar way to electron but in a more diy manner.
- I am using pyinstaller and autopytoexe to package my scripts and all of it’s dependencies.
- In the package I include a degoogled version of chromium portable
- When I run my packaged app it launches my dash python script alongside a PWA window of chromium to connect to the app local webserver (this you can achieve with the eel library )
Beware that if you want to do this there is a lot of fine tunning you have to do to make the everything run.
(like google webgl settings, configuring your paths correctly, choosing the right port for your dash app to run, etc. )
But once you get it working it’s magical
have fun!
1 Like
Hey thanks for this. With this setup, are you able to say, run you dash app, but make it not use the same port as, for instance 8080?
I would like it so that the user opens the app on the desktop application, but the port doesn’t get shared with the browser. So that I don’t even tell it the port I want to run the app on.
Right now, if I run my web app in an electron app, for instance, it will appear on port 8080, and then the user will see my app running both in the electron app, and on their own browser if they go to localhost:8080
There might be a way to achieve what you are describing, but it hasn’t been an issue for me so I haven’t checked.
1 Like