ixc / wagtail-instance-selector

A widget for Wagtail's admin that allows you to create and select related items
MIT License
54 stars 17 forks source link

TemplateDoesNotExist #4

Closed Redhaus closed 4 years ago

Redhaus commented 4 years ago

Hello sir,

I am having a strange issue. installed your recent django 3 update and now I am having issues with missing templates the previous version was working but since this update I get the error below.

I don't understand it because the templates are available in the folder path outlined any help you can provide would be much appreciated.

the app is registered installed apps it's being imported from instance_selector.edit_handlers import InstanceSelectorPanel

in panels, this is how it is being used

panels = [ InstanceSelectorPanel("collection"), ]

below is the trace stack when I try to create an item

Thank you

Template loader postmortem Django tried loading these templates, in this order:

Using engine django:

Template error: In template /Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/wagtail/admin/templates/wagtailadmin/shared/field.html, error at line 7 instance_selector/instance_selector_widget_display.html 1 : {% load wagtailadmin_tags %} 2 :

3 : {% if show_label|default_if_none:True %}{{ field.label_tag }}{% endif %} 4 :
5 :
6 : {% block form_field %} 7 : {{ field|render_with_errors }} 8 : {% endblock %} 9 :
10 : {# This span only used on rare occasions by certain types of input #} 11 : 12 :
13 : {% if show_help_text|default_if_none:True and field.help_text %} 14 :

{{ field.help_text }}

15 : {% endif %} 16 : 17 : {% if field|has_unrendered_errors %}

Traceback (most recent call last): File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/backends/django.py", line 61, in render return self.template.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 171, in render return self._render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/test/utils.py", line 95, in instrumented_test_render return self.nodelist.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 936, in render bit = node.render_annotated(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 903, in render_annotated return self.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/loader_tags.py", line 188, in render return template.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 173, in render return self._render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/test/utils.py", line 95, in instrumented_test_render return self.nodelist.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 936, in render bit = node.render_annotated(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 903, in render_annotated return self.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/loader_tags.py", line 53, in render result = self.nodelist.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 936, in render bit = node.render_annotated(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 903, in render_annotated return self.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 986, in render output = self.filter_expression.resolve(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 697, in resolve new_obj = func(obj, *arg_vals) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/wagtail/admin/templatetags/wagtailadmin_tags.py", line 252, in render_with_errors return bound_field.as_widget() File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/forms/boundfield.py", line 96, in as_widget renderer=self.form.renderer, File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/wagtail/utils/widgets.py", line 18, in render widget_html = self.render_html(name, value, attrs) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/instance_selector/widgets.py", line 28, in render_html instance_selector = registry.get_instance_selector(model) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/instance_selector/registry.py", line 43, in get_instance_selector instance_selector = ModelAdminInstanceSelector(model_admin=model_admin) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/instance_selector/selectors.py", line 68, in init super().init() File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/instance_selector/selectors.py", line 10, in init self.get_instance_display_template() File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/loader.py", line 19, in get_template raise TemplateDoesNotExist(template_name, chain=chain)

The above exception (instance_selector/instance_selector_widget_display.html) was the direct cause of the following exception: File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/backends/django.py", line 61, in render return self.template.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 171, in render return self._render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/test/utils.py", line 95, in instrumented_test_render return self.nodelist.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 936, in render bit = node.render_annotated(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 903, in render_annotated return self.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/defaulttags.py", line 209, in render nodelist.append(node.render_annotated(context)) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 903, in render_annotated return self.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 986, in render output = self.filter_expression.resolve(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 670, in resolve obj = self.var.resolve(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 795, in resolve value = self._resolve_lookup(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 857, in _resolve_lookup current = current() File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/wagtail/admin/edit_handlers.py", line 468, in render_as_object 'field': self.bound_field, File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/loader.py", line 62, in render_to_string return template.render(context, request) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/backends/django.py", line 63, in render reraise(exc, self.backend) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/backends/django.py", line 84, in reraise raise new from exc

The above exception (instance_selector/instance_selector_widget_display.html) was the direct cause of the following exception: File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/backends/django.py", line 61, in render return self.template.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 171, in render return self._render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/test/utils.py", line 95, in instrumented_test_render return self.nodelist.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 936, in render bit = node.render_annotated(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 903, in render_annotated return self.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/loader_tags.py", line 150, in render return compiled_parent._render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/test/utils.py", line 95, in instrumented_test_render return self.nodelist.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 936, in render bit = node.render_annotated(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 903, in render_annotated return self.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/loader_tags.py", line 150, in render return compiled_parent._render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/test/utils.py", line 95, in instrumented_test_render return self.nodelist.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 936, in render bit = node.render_annotated(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 903, in render_annotated return self.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/loader_tags.py", line 150, in render return compiled_parent._render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/test/utils.py", line 95, in instrumented_test_render return self.nodelist.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 936, in render bit = node.render_annotated(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 903, in render_annotated return self.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/loader_tags.py", line 62, in render result = block.nodelist.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 936, in render bit = node.render_annotated(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 903, in render_annotated return self.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/loader_tags.py", line 62, in render result = block.nodelist.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 936, in render bit = node.render_annotated(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 903, in render_annotated return self.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/loader_tags.py", line 62, in render result = block.nodelist.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 936, in render bit = node.render_annotated(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 903, in render_annotated return self.render(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 986, in render output = self.filter_expression.resolve(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 670, in resolve obj = self.var.resolve(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 795, in resolve value = self._resolve_lookup(context) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/base.py", line 857, in _resolve_lookup current = current() File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/wagtail/admin/edit_handlers.py", line 238, in render_form_content return mark_safe(self.render_as_object() + self.render_missing_fields()) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/wagtail/admin/edit_handlers.py", line 206, in render_as_object return self.render() File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/wagtail/admin/edit_handlers.py", line 310, in render 'self': self File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/loader.py", line 62, in render_to_string return template.render(context, request) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/backends/django.py", line 63, in render reraise(exc, self.backend) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/backends/django.py", line 84, in reraise raise new from exc

The above exception (instance_selector/instance_selector_widget_display.html) was the direct cause of the following exception: File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner response = get_response(request) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/core/handlers/base.py", line 145, in _get_response response = self.process_exception_by_middleware(e, request) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/core/handlers/base.py", line 143, in _get_response response = response.render() File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/response.py", line 105, in render self.content = self.rendered_content File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/response.py", line 83, in rendered_content return template.render(context, self._request) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/backends/django.py", line 63, in render reraise(exc, self.backend) File "/Users/redbook/.local/share/virtualenvs/wagtail04-U6tFrRhI/lib/python3.7/site-packages/django/template/backends/django.py", line 84, in reraise raise new from exc

Exception Type: TemplateDoesNotExist at /admin/events/eventoverview/create/ Exception Value: instance_selector/instance_selector_widget_display.html

Redhaus commented 4 years ago

i figured out the issue

markfinger commented 4 years ago

Off the top of my head, I'd guess 'instance_selector' was missing from INSTALLED_APPS. Was that the solution, @Redhaus?