Home > Blockchain >  Django server not reloading on file changes
Django server not reloading on file changes

Time:05-22

I just cloned a Django project from my Github for maintenance on another machine, installed all the dependencies then ran the server. Everything seems to be working fine except the fact that the server does not reload when I make file changes (on all python files). Changes in static files are not reflected too. Things to note:

  • Django 4.0.3
  • Python 3.9.0
  • Environment manager is Pipenv.

Settings.py

DEBUG = True

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, "templates")],

I don't have a custom runserver command
I have the suggestions on this question but they didn't work.

Any help would be greatly appreciated.

CodePudding user response:

To reload all static files in the browser you need to press ctrl f5 (refreshes cache)

Also, make sure to run the python manage.py collectstatic command to save all static files in a single directory or even use compressed storage.

For all python files, make sure that autosave is enabled on Visual Studio Code (I have faced this issue too)

  • Related