Hi,
I am getting the following error:
TemplateDoesNotExist
Exception Value: django_filters/rest_framework/crispy_form.html
Exception Location: /home/dheeraj/.virtualenvs/ngcrp_env/lib/python3.5/site-packages/django/template/loader.py in get_template, line 25
Python Executable: /home/dheeraj/.virtualenvs/ngcrp_env//bin/python3.5
Following are the packages I have:
django-filter Version: 1.0.4
djangorestframework Version: 3.6.3
Django Version: 1.11.2
django-crispy-forms Version: 1.6.1
Following is traceback:
Traceback:
File "/home/dheeraj/.virtualenvs/ngcrp_env/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner
File "/home/dheeraj/.virtualenvs/ngcrp_env/lib/python3.5/site-packages/django/core/handlers/base.py" in _legacy_get_response
File "/home/dheeraj/.virtualenvs/ngcrp_env/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
File "/home/dheeraj/.virtualenvs/ngcrp_env/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
File "/home/dheeraj/.virtualenvs/ngcrp_env/lib/python3.5/site-packages/django/template/response.py" in render
File "/home/dheeraj/.virtualenvs/ngcrp_env/lib/python3.5/site-packages/rest_framework/response.py" in rendered_content
File "/home/dheeraj/.virtualenvs/ngcrp_env/lib/python3.5/site-packages/rest_framework/renderers.py" in render
File "/home/dheeraj/.virtualenvs/ngcrp_env/lib/python3.5/site-packages/rest_framework/renderers.py" in get_context
File "/home/dheeraj/.virtualenvs/ngcrp_env/lib/python3.5/site-packages/rest_framework/renderers.py" in get_filter_form
File "/home/dheeraj/.virtualenvs/ngcrp_env/lib/python3.5/site-packages/django_filters/rest_framework/backends.py" in to_html
File "/home/dheeraj/.virtualenvs/ngcrp_env/lib/python3.5/site-packages/django/template/loader.py" in get_template
Could you please help here...
Thanks.
Dheeraj
error was gone by adding django_filters to installed apps as suggested by carltongibson.
@devrishu I think a better solution is probably to make sure django_filters
is added to INSTALLED_APPS
. (That way the templates will be found.)
@carltongibson thanks for your help. It worked !!!
Make sure you added "django_filters" to INSTALLED_APPS
Make sure you added "django_filters" to INSTALLED_APPS (take care about the 's')
and the underscore "django_filters"
Most helpful comment
@devrishu I think a better solution is probably to make sure
django_filters
is added toINSTALLED_APPS
. (That way the templates will be found.)