4
votes

I am working in a dev environment using the built in Django web server. One of the inconvenience that I have is everytime I make changes in HTML or Static files it does not apply when I reload the browser until I kill the dev server and run again.

python manage.py runserver localhost:8000

Is there a way so Django will reflect the changes instantly? Thanks in advance

1
That's weird, they should be reflected in the page without restarting the server. Do you have additional process to compile static files?Shang Wang
Have you run collectstatic command?doru
This happens to me sometimes when I enable caching, such as a cached template loader? Try using a dummy cache backend for development.tutuDajuju
You can find same question here stackoverflow.com/questions/42782337/…Isanka Wijerathne

1 Answers

1
votes

Django reload the server only on changes on .py files. I read different ways to trigger reloading (such as installing a third party app, tweaking caching depending on whether DEBUG = True, etc etc).

The easiest and dumbest way is to make an insignificant slight change in the view you're working on (say, adding a #, removing it) after you edited and saved your template. It is dumb but it works.