How does Django and/or my webserver keep straight which files it should be using when I switch Git branches?
My understanding is that when I checkout a branch in Git that the actual file system is modified. Is this true? If yes, how does Django and the webserver keep the files in tact that existed when I started the server?
For Example:
Create views.py on master branch
return HttpResponse("<h1>Hello world!</h1>")
Start server (using daphne):
daphne -b 0.0.0.0 -p 9000 my_app.asgi:application
my app output:
Hello world!
Make modifications in views.py (development branch)
return HttpResponse("<h1>Thanks for Visting!</h1>")
Page refresh
Output does not change:
Hello world!
Bring down server
Ctrl + C
Start server (using daphne):
daphne -b 0.0.0.0 -p 9000 my_app.asgi:application
New Output
Thanks for Visting!
I understand hot reloading is a feature, but how does Django and the web server avoid using the modified files on the new branch?