Search code examples
djangoubuntunginxservergunicorn

How to re-deploy Django changes in linux


My application is up and running on my server. I'm using linux Nginx and Gunicorn. I'm logging in to the server using ssh with private key.

My question is how do I re-deploy updated version of the application?

My first attempt was cloning the project from my git repository into a directory on my server. Cloning it again doesn't seem like a good option.


Solution

  • You can just pull your updates from your remote repository, then restart your gunicorn it will be updated immediately.

    1. cd /project-path
    2. git pull origin your-branch-name
    3. Restart your gunicorn based on how are you running it.

    You can automate this using any CI/CD like Gitlab CI.