FileNotFoundError when using pathlib.Path with Django's storage system
I tried several approaches but none seem to work... I'm working on a Django application and trying to load a CSV file from a specific directory using `pathlib.Path`. However, I keep working with a `FileNotFoundError`. Here's the relevant snippet of my code: ```python from pathlib import Path from django.core.files.storage import default_storage file_path = Path('data/my_file.csv') if default_storage.exists(file_path): with default_storage.open(file_path) as f: data = f.read() else: print(f'File not found: {file_path}') ``` The `my_file.csv` file definitely exists in the `data` directory, which is located at the root of my Django project. I’ve tried using different methods to load the file, like `os.path` and even directly specifying the full path, but the scenario continues. The behavior I get is: ``` FileNotFoundError: [Errno 2] No such file or directory: 'data/my_file.csv' ``` I also tried checking the working directory using `os.getcwd()`, and it seems to return the correct project directory. I'm using Django 4.0.3 and Python 3.9.7. Could this be an scenario with how Django's storage backend interacts with `pathlib.Path`? Any suggestions on how to correctly access the file would be greatly appreciated! I'd really appreciate any guidance on this.