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

Watchfiles watches files outside of django source root #83

Closed
KIC opened this issue Apr 9, 2024 · 4 comments
Closed

Watchfiles watches files outside of django source root #83

KIC opened this issue Apr 9, 2024 · 4 comments

Comments

@KIC
Copy link

KIC commented Apr 9, 2024

Python Version

3.11

Django Version

5.x

Package Version

0.1.0

Description

Watchfiles watches files outside of the django BASE_DIR i.e. in local docker volumes and fails with permission denied.
PermissionError: Permission denied (os error 13) about

Warchfiles should only watch from BASE_DIR or allow some folders to be excluded via configuration.

@adamchainz
Copy link
Owner

django.BASE_DIR is not a reliable setting for “all the files in the project”. For example, TEMPLATES can be configured with paths outside of it.

django-watchfiles does nothing special with paths - it only tries to watch the paths that Django would watch anyway - python files, templates, etc. I would expect that if you see an error with watchfiles, you see it without (Django’s StatLoader), or at least with Django’s Watchman support. Can you check those options?

@KIC
Copy link
Author

KIC commented May 10, 2024

I would prefer a setting variable where we can exclude certain paths. much like #11

for now i sudo chmod 777 my docker volume. it works but it's nasty and I have to do this quite often.

@adamchainz
Copy link
Owner

You didn’t respond to my request about what happens with StatLoader or watchman.

I am not sure we should add any setting here, as the file paths to watch all come from Django.

@adamchainz
Copy link
Owner

Closing for now, unless we get any extra details.

@adamchainz adamchainz closed this as not planned Won't fix, can't repro, duplicate, stale Oct 28, 2024
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

No branches or pull requests

2 participants