GIT and Django Projects

Posted by Garfonzo on Server Fault See other posts from Server Fault or by Garfonzo
Published on 2012-10-29T15:37:31Z Indexed on 2012/10/29 17:04 UTC
Read the original article Hit count: 171

Filed under:
|

I have two servers, a Dev server and a Production server. The Production server runs a live Django site, while the Dev server has a copy of the Django project. I use the Dev server to work on the Django site, make improvements, fix bugs, etc. Once I am satisfied with how the Dev version is working, I move the whole Django directory from the Dev server and replace the same directory on the Production server. The two servers are not on the same LAN so the process is not straight forward.

There are a few issues with this that I am having so far.

  1. Moving the whole directory is laborious and time consuming
  2. If I only change a few files, it is even move tedious to replace a few files than the whole directory since the project is getting fairly large and I worry that I'll miss something
  3. I often run into permission issues after I've moved things
  4. It's super inefficient, and, due to lack of time, I haven't bothered figuring out a new method. Now it's just getting out of hand and i need to address the situation.

I am thinking I need to move to a GIT repository for this process. But my question is how would I set this all up?

  • Do I host the repository on the Production server, pull from the Dev server, do work, then commit? Then I would pull from the Production server (same server the repo is hosted on) to run the current working version?
  • Do I host the repo on the Dev Server, pulling from the same server to do work on the repo, then pull a working version onto the Production server?
  • Should I be hosting the repo on a different server than the Production server and the Dev server (a third server)?
  • Are there any special considerations with Django and repos that I need to worry about?

Thanks for the help :)

© Server Fault or respective owner

Related posts about git

Related posts about django