-
Notifications
You must be signed in to change notification settings - Fork 50
error PatternLibraryEmpty #116
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I appreciate this was a while ago, sorry for the slow response. This error means that there are no templates in the locations that that pattern library expects to find them. Could you tell me:
|
Hi @bcdickinson, requirements.txt: base.py:
structure: I'm looking forward to use your tool and the Atomic methodology, thanks. |
Your |
I tried to add another app and it works fine, @allcaps thanks.
|
Tests directory is project config code and not an 'app'. Equivalent to the output of 'django-admin startproject tests' However, any folder that contains an init can be a Django app. So adding this directory to installed apps let's Django discover the templates. Project layouts are always a bit opinionated. :) I'd like to keep templates in apps, instead of one global template folder. @bcdickinson Does that make sense with PL? App loader templates in multiple locations? |
I will close this now as I believe our most recent release will likely have helped with this. The pattern library now supports crawling all apps’ templates, and soon will also support |
This commit modifies the django-pattern-library to use pathlib.Path for template paths. This ensures that the paths are handled consistently across different operating systems, including Windows. The following functions have been modified to use pathlib.Path: path_to_section() section_for() get_template_dirs() get_pattern_config_str() get_pattern_markdown() Additionally, the TemplateRenderer.get_pattern_templates() method has been updated to use pathlib.Path for template paths. possibly related issue: torchbox#116
I can't seem to get this working in a Django app or a Wagtail app. I'm getting...
Internal Server Error: /pattern-library/ Traceback (most recent call last): File "/home/arashi/.cache/pypoetry/virtualenvs/portfolio-Iy91sLkC-py3.8/lib64/python3.8/site-packages/django/core/handlers/exception.py", line 34, in inner response = get_response(request) File "/home/arashi/.cache/pypoetry/virtualenvs/portfolio-Iy91sLkC-py3.8/lib64/python3.8/site-packages/django/core/handlers/base.py", line 115, in _get_response response = self.process_exception_by_middleware(e, request) File "/home/arashi/.cache/pypoetry/virtualenvs/portfolio-Iy91sLkC-py3.8/lib64/python3.8/site-packages/django/core/handlers/base.py", line 113, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/arashi/.cache/pypoetry/virtualenvs/portfolio-Iy91sLkC-py3.8/lib64/python3.8/site-packages/django/views/generic/base.py", line 71, in view return self.dispatch(request, *args, **kwargs) File "/home/arashi/.cache/pypoetry/virtualenvs/portfolio-Iy91sLkC-py3.8/lib64/python3.8/site-packages/django/views/generic/base.py", line 97, in dispatch return handler(request, *args, **kwargs) File "/home/arashi/.cache/pypoetry/virtualenvs/portfolio-Iy91sLkC-py3.8/lib64/python3.8/site-packages/pattern_library/views.py", line 43, in get pattern_template_name = self.get_first_template(templates) File "/home/arashi/.cache/pypoetry/virtualenvs/portfolio-Iy91sLkC-py3.8/lib64/python3.8/site-packages/pattern_library/views.py", line 31, in get_first_template raise PatternLibraryEmpty( pattern_library.exceptions.PatternLibraryEmpty: No templates found in the pattern library at '/home/arashi/snow/Websites/Django/portfolio/project_styleguide/templates'
The templates are working for the project as a whole, but I can't go to /pattern-library/ . I get the error
PatternLibraryEmpty at /pattern-library/
The text was updated successfully, but these errors were encountered: