vittoriozamboni / django-groups-manager

Manage django groups collection based on django-mptt.
MIT License
100 stars 23 forks source link

TemplateDoesNotExist at /api/v1/groups-manager/ #33

Closed thapabishwa closed 5 years ago

thapabishwa commented 5 years ago

Hey guys, I tried to use the groups-manager url and got the following exception.


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

Using engine django:
    * django.template.loaders.filesystem.Loader: /code/vitapio/static/base.html (Source does not exist)
    * django.template.loaders.app_directories.Loader: /usr/local/lib/python3.6/site-packages/django/contrib/admin/templates/base.html (Source does not exist)
    * django.template.loaders.app_directories.Loader: /usr/local/lib/python3.6/site-packages/django/contrib/auth/templates/base.html (Source does not exist)
    * django.template.loaders.app_directories.Loader: /usr/local/lib/python3.6/site-packages/rest_framework/templates/base.html (Source does not exist)
    * django.template.loaders.app_directories.Loader: /usr/local/lib/python3.6/site-packages/django_filters/templates/base.html (Source does not exist)
    * django.template.loaders.app_directories.Loader: /usr/local/lib/python3.6/site-packages/drf_yasg/templates/base.html (Source does not exist)
    * django.template.loaders.app_directories.Loader: /usr/local/lib/python3.6/site-packages/guardian/templates/base.html (Source does not exist)
    * django.template.loaders.app_directories.Loader: /usr/local/lib/python3.6/site-packages/groups_manager/templates/base.html (Source does not exist)
    * django.template.loaders.app_directories.Loader: /usr/local/lib/python3.6/site-packages/bootstrap3/templates/base.html (Source does not exist)

Template error:
In template /usr/local/lib/python3.6/site-packages/groups_manager/templates/groups_manager/bootstrap3/groups_manager.html, error at line 1
   base.html
   1 :  {% extends "base.html" %} 
   2 : 
   3 : 
   4 : {% block breadcrumbs %}
   5 :   {{ block.super }}
   6 :   <li>
   7 :     <a href="{% url 'groups_manager:groups_manager' %}">Groups Manager</a>
   8 :   </li>
   9 : {% endblock breadcrumbs %}
   10 : 
   11 : 

Traceback:

File "/usr/local/lib/python3.6/site-packages/django/template/backends/django.py" in render
  61.             return self.template.render(context)

File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in render
  171.                     return self._render(context)

File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in _render
  163.         return self.nodelist.render(context)

File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in render
  937.                 bit = node.render_annotated(context)

File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/usr/local/lib/python3.6/site-packages/django/template/loader_tags.py" in render
  150.             return compiled_parent._render(context)

File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in _render
  163.         return self.nodelist.render(context)

File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in render
  937.                 bit = node.render_annotated(context)

File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/usr/local/lib/python3.6/site-packages/django/template/loader_tags.py" in render
  127.         compiled_parent = self.get_parent(context)

File "/usr/local/lib/python3.6/site-packages/django/template/loader_tags.py" in get_parent
  124.         return self.find_template(parent, context)

File "/usr/local/lib/python3.6/site-packages/django/template/loader_tags.py" in find_template
  104.             template_name, skip=history,

File "/usr/local/lib/python3.6/site-packages/django/template/engine.py" in find_template
  130.         raise TemplateDoesNotExist(name, tried=tried)

The above exception (base.html) was the direct cause of the following exception:

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
  34.             response = get_response(request)

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  156.                 response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  154.                 response = response.render()

File "/usr/local/lib/python3.6/site-packages/django/template/response.py" in render
  106.             self.content = self.rendered_content

File "/usr/local/lib/python3.6/site-packages/django/template/response.py" in rendered_content
  83.         content = template.render(context, self._request)

File "/usr/local/lib/python3.6/site-packages/django/template/backends/django.py" in render
  63.             reraise(exc, self.backend)

File "/usr/local/lib/python3.6/site-packages/django/template/backends/django.py" in reraise
  84.     raise new from exc

Exception Type: TemplateDoesNotExist at /api/v1/groups-manager/
Exception Value: base.html
vittoriozamboni commented 5 years ago

Hi @thapabishwa , groups_manager.html extends base.html, as state in https://django-groups-manager.readthedocs.io/en/latest/templates.html . You can override groups_manager.html to inherit from your main template file.

thapabishwa commented 5 years ago

Thanks @vittoriozamboni , I extended the base.html. And was able to use the url.