I tried Django 3 a few months ago, and it all worked well. The browser refreshed itself after I made a change to files (.html and .py).
Now I have an issue with it, the browser doesn’t automatically reload after I saved a change that I made on my local machine.
OS: Windows 11
Editor: PyCharm / VS Code
Django 4.0.4
Python 3.10.4
Directory structure
project/
├── project/
│ ├── ...
│ ├── settings.py
│ ├── urls.py
│ └── ...
├── first_app/
│ ├── ...
│ ├── urls.py
│ ├── views.y
│ └── ...
├── templates/
│ └── first_app/
│ └── index_view.html
└── manage.py
Default settings.py file with
....
INSTALLED_APPS = [
...
'first_app',
...
]
'DIRS': [BASE_DIR / 'templates']
....
project/urls.py
....
urlpatterns = [
path('', include('first_app.urls')
]
....
first_app/views.py
....
class IndexView(generic.TemplateView):
template_name = 'first_app/index_view.html'
...
first_app/urls.py
....
urlpatterns = [
path('', views.IndexView.as_view(), name='index')
]
....
templates/first_app/index_view.html
....
<p>
Test paragraph 1
</p>
....
I run the server locally with py manage.py runserver
When I change ‘paragraph’ to ‘example’ and save it, the browser doesn’t reload. It is supposed to automatically refresh the browser and display Test example 1. But it doesn’t work for me.
I have created multiple projects and the result is still the same.
Am I missing something?
Thanks.