Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use watchman when calling runserver in local development #6813

Merged
merged 1 commit into from Mar 26, 2020

Conversation

humitos
Copy link
Member

@humitos humitos commented Mar 24, 2020

watchman is the replacement of pyinotify and it's the recommended way on Linux and MacOS.

https://docs.djangoproject.com/en/2.2/ref/django-admin/#runserver

Django will automatically detect that this is installed and use watchman instead of pyinotify, showing this log in the terminal:

django.utils.autoreload:597[20]: INFO Watching for file changes with WatchmanReloader

This change could help to reduce the CPU usage when running docker-compose locally.

This is a continuation of the work done in #6812.

watchman is the replacement of pyinotify and it's the recommended way
on Linux and MacOS.

https://docs.djangoproject.com/en/2.2/ref/django-admin/#runserver

This change could help to reduce the CPU usage when running
docker-compose locally.
@humitos humitos requested a review from Mar 24, 2020
Copy link
Contributor

@davidfischer davidfischer left a comment

I verified that this built correctly. I saw in the output that it was using watchman and reloaded correctly.

I'm not 100% sure it will help much since the watching is actually happening via docker on Linux instead of on MacOS directly where Watchman was designed to help most. Worth a try, I suppose.

@humitos
Copy link
Member Author

@humitos humitos commented Mar 26, 2020

I'm merging. Let's see how goes. At least is seems better in my laptop. We can easily revert if needed.

@humitos humitos merged commit 8e55213 into master Mar 26, 2020
1 of 3 checks passed
@humitos humitos deleted the humitos/use-watchman-compose branch Mar 26, 2020
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.

None yet

2 participants