mirror of
https://github.com/django-components/django-components.git
synced 2025-08-08 08:17:59 +00:00
Handle case with SETTINGS_MODULE not set.
This commit is contained in:
parent
681c540cb7
commit
f5c3f64c86
1 changed files with 9 additions and 7 deletions
|
@ -13,6 +13,8 @@ class Loader(FilesystemLoader):
|
||||||
def get_dirs(self):
|
def get_dirs(self):
|
||||||
component_dir = "components"
|
component_dir = "components"
|
||||||
directories = list(get_app_template_dirs(component_dir))
|
directories = list(get_app_template_dirs(component_dir))
|
||||||
|
|
||||||
|
if settings.SETTINGS_MODULE:
|
||||||
settings_path = Path(*settings.SETTINGS_MODULE.split("."))
|
settings_path = Path(*settings.SETTINGS_MODULE.split("."))
|
||||||
|
|
||||||
path = (settings_path / ".." / component_dir).resolve()
|
path = (settings_path / ".." / component_dir).resolve()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue