0

I have successfully built several web sites hosted on an Nginx server using Django, uWSGI and virtualenv.

I had never used version control but now I am starting to use Git.

I understand how to create, commit and push branches.

My question is: how to make different Git branches visible at the web address of the site I'm working on?

Do I change the Nginx config file to point somewhere different?

I just updated the dev branch of my project, and of course the site does not reflect the changes.

How can I tell the server to serve the dev branch or the master branch of the project?

I would prefer to avoid a complicated system with different subdomains for different branches — I really just want the simplest thing that will work.

[update] I have found lots of pages that explain complex ways to set up staging servers etc., but I really just want to understand what is going on... there's a giant conceptual hole in my understanding about how the server interacts with a local Git project.

Right now, the Nginx config and the uWSGI config point to a folder like:

/var/www/sitefiles

That is the Django folder (inside it is sitefiles/settings.py etc.).

It is in that folder that I did git init, some commits, branching & pushes.

Does using Git mean that the Nginx and uWSGI config's should point elsewhere?

Andy Swift
  • 2,179
  • 3
  • 32
  • 53

1 Answers1

0

Its pretty simple goto the path of the project where git is installed and checkout to required banch and touch the wsgi file

git checkout dev
touch project/wsgi.py

or to roll back to master branch

git checkout master
touch project/wsgi.py
Pavan Kumar T S
  • 1,539
  • 2
  • 17
  • 26