I developed an accounting software with django which will be only used on the local server of client’s computer. My question is: How do I setup the dependencies on clients computer? Do I install all dependencies individually? Or put my project onto a virtual env and move the virtual env into the clients PC? Or should I dockerize the app?
3
Answers
It totally depends on the complexity of your project. Docker could be the best option, but if you have limited dependencies in your project, then virtual environment is enough.
Start with what you need.
Create a python virtual env and install dependencies there. Ensure that a
requirements.txt
is created and added to source control on the project.You may want to create a service or systemd unit file to automatically start the server when the system starts up.
As others have mentioned, you can use a virtual environment and install requirements from
requirements.txt
. An easy way to create these is runningpip freeze > requirements.txt
.However, this can still cause issues if the client has a different Python version installed. Dockerizing the app would ensure everything, from Python version to dependencies, will be the same between systems.