Skip to content

Conversation

foarsitter
Copy link
Contributor

This pull-request is the second attempt (see #1775 for details) to get the correct behavior for reloading of the development server.

The watchdog reloader did accept the *.html wildcard pattern but the stat reloader isn't.

Therefore this pull-request adds an list of all files inside all template directories to extra_files. Even non .html files inside the template directories are triggering a reload since it can occur other extensions are used for templates like .css & .js. New files added to the template directory also trigger a reload since this is the same behavior as runserver.

Thanks to @bmihelac for providing feedback to my first attempt.

@foarsitter foarsitter force-pushed the runserver_plus_autoreload_templates_statloader branch from 45c14ed to 7bf8b99 Compare January 28, 2023 16:02
@bmihelac
Copy link
Contributor

bmihelac commented Feb 1, 2023

I have tested this and can confirm that it reloads updated and new files.

@nattyg93
Copy link

nattyg93 commented Mar 8, 2023

Hi folks, I've just run into this one myself is this likely to be merged any time soon?

@wgordon17
Copy link

Just chiming in to agree that this has solved the issue for me as well (where it was not solved for me in #1775). @trbs any hope of getting a review on this please? 🙏

@foarsitter I suspect it would help if you address the failing pytest checks

@foarsitter
Copy link
Contributor Author

Thanks for testing @wgordon17.

If I recall correctly, the tests are fixed in #1797 as reported in #1812.

@trbs
Copy link
Member

trbs commented Apr 29, 2023

Guess the flip side is that it can be annoying as well that files which has nothing to do with "runserver" triggers a reload...

Maybe this kind of behavior would also be nice to be controlled via some cli options && settings..

@trbs trbs merged commit 9484207 into django-extensions:main Apr 29, 2023
@danjesus
Copy link

Hey guys, anyone else still having this problem?

Not working with runserver_plus, only with runserver.

With django-extensions version 3.2.3

@foarsitter
Copy link
Contributor Author

Open an issue with a minimal failing example if you think the problem still exists. It should be solved in 3.2.3.

@foarsitter foarsitter deleted the runserver_plus_autoreload_templates_statloader branch November 21, 2023 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants