Why do i need to restart my docker container to see changes in django views.py file on windows

Why do I have to restart my docker container every time I make a change in my Django python files? I'm running a Django app via Docker and it seems any changes I make in my Views(and possibly elsewhere) are not reflected until I restart my container.

For example, if I log an output to the terminal or make changes, then refresh, there's no change. If I restart my container and then refresh, I get the result I would expect.

As I know you can consider Docker environment like immutable type doesn’t allow any change in the object once it has been created.

And that will give us more security. If you want a solution there is some vs code extensions can run script contain some command after you edit your files, you can insert docker command in this script to reload environment after you edit any file

Good luck

Back to Top