-1

I am creating an open-source web app using Django that anyone can install on their local machine, Heroku, etc. The most obvious way for the clients to get updates in the app is to ask them to pull the latest version from GitHub. Is there a cleaner, more elegant way to do this? For example, can we have a webpage (in the same Django project) which has a button to trigger an update from GitHub, while the web app is already running?

TLDR: How to make a Django web app update its own code when it's told to do so?

EDIT: I expect the app to be run either through shell (say through unicorn or the like) or on a Python PaaS like Heroku or Render. Happy to consider other alternatives, preferably a cross platform solution.

NKS
  • 165
  • 1
  • 8
  • this needs more detail, what are you using to package the app? do they install it on the machine using an exe file? do you even have an exe file or how do you build it? How do they install it? Is it just a view for another page you control? If you have e.g. an exe file you can make that do automatic updates. If you just ask your customers to go to a shell and run `python manage.py runserver` of course that's different and I'm not sure you could have automatic updates in that case, although it is possible. Would then probably be easier to ask them to install a script to check and pull the code – Matthias Sep 01 '23 at 08:56
  • I was thinking either they run it from the shell (through gunicorn for example) or through some Python PaaS like Heroku or Render. If that isn't possible, I am happy to consider alternatives like the exe file you mentioned (I would prefer a cross platform solution). – NKS Sep 01 '23 at 11:04
  • If they run it like that, those servers, gunicorn for example have a --reload feature which you could use. Then you can have a service (not sure how you make that crossplatform) to pull the new git code. However, I'd recommend into looking into some more proper way to deliver software, asking users to open a shell and run some python commands is mostly suited for ppl with tech knowledge. But again, this is too broad to discuss here, you just have to research and ask again with a more specific question. – Matthias Sep 01 '23 at 11:45
  • For example: https://stackoverflow.com/questions/58216039/what-is-the-best-way-to-deliver-django-project-as-a-full-installation-file-setu – Matthias Sep 01 '23 at 11:47

0 Answers0