Don't rely on BASE_DIR being a Path.

This commit is contained in:
Emil Stenström 2024-02-21 21:36:11 +01:00
parent f3350ced11
commit a32128a420
2 changed files with 2 additions and 2 deletions

View file

@ -106,7 +106,7 @@ Modify STATICFILES_DIRS (or add it if you don't have it) so django can find your
```python
STATICFILES_DIRS = [
...,
BASE_DIR / "components",
os.path.join(BASE_DIR, "components"),
]
```

View file

@ -15,7 +15,7 @@ class Loader(FilesystemLoader):
directories = set(get_app_template_dirs(component_dir))
if hasattr(settings, "BASE_DIR"):
path = (settings.BASE_DIR / component_dir).resolve()
path = (Path(settings.BASE_DIR) / component_dir).resolve()
if path.is_dir():
directories.add(path)