Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TemplateDoesNotExist: django_filters/rest_framework/form.html #562

Closed
cancan101 opened this issue Nov 15, 2016 · 9 comments
Closed

TemplateDoesNotExist: django_filters/rest_framework/form.html #562

cancan101 opened this issue Nov 15, 2016 · 9 comments

Comments

@cancan101
Copy link

cancan101 commented Nov 15, 2016

I am getting:

Traceback (most recent call last):
  File "/Users/alex/.virtualenvs/storage/lib/python2.7/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/Users/alex/.virtualenvs/storage/lib/python2.7/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/Users/alex/.virtualenvs/storage/lib/python2.7/site-packages/django/core/handlers/base.py", line 217, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/Users/alex/.virtualenvs/storage/lib/python2.7/site-packages/django/core/handlers/base.py", line 215, in _get_response
    response = response.render()
  File "/Users/alex/.virtualenvs/storage/lib/python2.7/site-packages/django/template/response.py", line 109, in render
    self.content = self.rendered_content
  File "/Users/alex/.virtualenvs/storage/lib/python2.7/site-packages/rest_framework/response.py", line 72, in rendered_content
    ret = renderer.render(self.data, accepted_media_type, context)
  File "/Users/alex/.virtualenvs/storage/lib/python2.7/site-packages/rest_framework/renderers.py", line 701, in render
    context = self.get_context(data, accepted_media_type, renderer_context)
  File "/Users/alex/.virtualenvs/storage/lib/python2.7/site-packages/rest_framework/renderers.py", line 678, in get_context
    'filter_form': self.get_filter_form(data, view, request),
  File "/Users/alex/.virtualenvs/storage/lib/python2.7/site-packages/rest_framework/renderers.py", line 613, in get_filter_form
    html = backend().to_html(request, queryset, view)
  File "/Users/alex/.virtualenvs/storage/lib/python2.7/site-packages/rest_framework_filters/backends.py", line 34, in to_html
    template = loader.get_template(self.template)
  File "/Users/alex/.virtualenvs/storage/lib/python2.7/site-packages/django/template/loader.py", line 25, in get_template
    raise TemplateDoesNotExist(template_name, chain=chain)
TemplateDoesNotExist: django_filters/rest_framework/form.html

I have:

django-filter==0.15.3
djangorestframework==3.5.3

Perhaps the issues was introducted by?: 48f35b2

@cancan101
Copy link
Author

I also have this which might be causing issues:

djangorestframework-filters==0.9.0

@cancan101
Copy link
Author

Looks like the issue has been fixed: philipn/django-rest-framework-filters#129

@source-creator
Copy link

source-creator commented Apr 2, 2017

I also get this error, using:

django==1.10.6
django-filter==1.0.2
djangorestframework==3.6.2

If I revert to the following, then it works.

django-filter==0.15.3

@rpkilby
Copy link
Collaborator

rpkilby commented Apr 3, 2017

Hi @timothycoutlakis - I believe this is the same issue as #666. You may need to add 'django_filters' to INSTALLED_APPS.

@source-creator
Copy link

Thank you @rpkilby, that solved it.

@harsharastogi
Copy link

harsharastogi commented Apr 5, 2017

@adding 'django-filters' in the apps list inside settings.py solved the issue. I was using following configuration as well

django==1.10.6
django-filter==1.0.2
djangorestframework==3.6.2

Django rest framework documentation should be updated

@luis-wang
Copy link

@timothycoutlakis this trick works for me, thanks.

rlucioni pushed a commit to openedx/credentials that referenced this issue Jul 13, 2017
This fixes an issue which prevents the browseable API from rendering. For more details, see carltongibson/django-filter#562.

LEARNER-1590
rlucioni pushed a commit to openedx/credentials that referenced this issue Jul 13, 2017
This fixes an issue which prevents the browseable API from rendering. For more details, see carltongibson/django-filter#562.

LEARNER-1590
rlucioni pushed a commit to openedx/credentials that referenced this issue Jul 13, 2017
This fixes an issue which prevents the browseable API from rendering. For more details, see carltongibson/django-filter#562.

LEARNER-1590
@Animatr
Copy link

Animatr commented Jun 10, 2020

Hi @timothycoutlakis - I believe this is the same issue as #666. You may need to add 'django_filters' to INSTALLED_APPS.
thank you @rpkilby

numahell added a commit to numahell/dicodigital-api that referenced this issue Oct 16, 2020
mloeks added a commit to mloeks/rtg that referenced this issue Jan 10, 2021
Resolved some issues with DjangoFilterBackend and filter_fields,
cf. carltongibson/django-filter#562
@dombroks
Copy link

dombroks commented Aug 7, 2022

Adding 'django_filters' in installed apps worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants