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 Multiple API endpoints #1210

Closed
mw-0 opened this issue May 22, 2017 · 5 comments
Closed

TemplateDoesNotExist Multiple API endpoints #1210

mw-0 opened this issue May 22, 2017 · 5 comments

Comments

@mw-0
Copy link

mw-0 commented May 22, 2017

Issue type:

Python version: 2.7.5
NetBox version: 2.0.3

On a fresh build from master i cannot open various api endpoints without an error.
Example.
api/dcim/regions/ works fine
/api/dcim/sites/ produces error:
TemplateDoesNotExist at /api/dcim/sites/
django_filters/rest_framework/form.html
Request Method: GET
Request URL: http://****/api/dcim/sites/
Django Version: 1.11.1
Exception Type: TemplateDoesNotExist
Exception Value:
django_filters/rest_framework/form.html
Exception Location: /usr/lib/python2.7/site-packages/django/template/loader.py in get_template, line 25
Python Executable: /usr/bin/python
Python Version: 2.7.5
Python Path:
['/opt/netbox/netbox',
'/opt/netbox/netbox',
'/usr/bin',
'/usr/lib64/python27.zip',
'/usr/lib64/python2.7',
'/usr/lib64/python2.7/plat-linux2',
'/usr/lib64/python2.7/lib-tk',
'/usr/lib64/python2.7/lib-old',
'/usr/lib64/python2.7/lib-dynload',
'/usr/lib64/python2.7/site-packages',
'/usr/lib64/python2.7/site-packages/gtk-2.0',
'/usr/lib/python2.7/site-packages']
Server time: Mon, 22 May 2017 09:53:59 +0000
Template-loader postmortem

Django tried loading these templates, in this order:

Using engine django:
django.template.loaders.filesystem.Loader: /opt/netbox/netbox/templates/django_filters/rest_framework/form.html (Source does not exist)
django.template.loaders.app_directories.Loader: /usr/lib/python2.7/site-packages/django/contrib/admin/templates/django_filters/rest_framework/form.html (Source does not exist)
django.template.loaders.app_directories.Loader: /usr/lib/python2.7/site-packages/django/contrib/auth/templates/django_filters/rest_framework/form.html (Source does not exist)
django.template.loaders.app_directories.Loader: /usr/lib/python2.7/site-packages/debug_toolbar/templates/django_filters/rest_framework/form.html (Source does not exist)
django.template.loaders.app_directories.Loader: /usr/lib/python2.7/site-packages/django_tables2/templates/django_filters/rest_framework/form.html (Source does not exist)
django.template.loaders.app_directories.Loader: /usr/lib/python2.7/site-packages/mptt/templates/django_filters/rest_framework/form.html (Source does not exist)
django.template.loaders.app_directories.Loader: /usr/lib/python2.7/site-packages/rest_framework/templates/django_filters/rest_framework/form.html (Source does not exist)
django.template.loaders.app_directories.Loader: /usr/lib/python2.7/site-packages/rest_framework_swagger/templates/django_filters/rest_framework/form.html (Source does not exist)
django.template.loaders.app_directories.Loader: /opt/netbox/netbox/secrets/templates/django_filters/rest_framework/form.html (Source does not exist)
django.template.loaders.app_directories.Loader: /opt/netbox/netbox/utilities/templates/django_filters/rest_framework/form.html (Source does not exist)

I get get to endpoint with siteid using /api/dcim/sites/2/

@mw-0
Copy link
Author

mw-0 commented May 22, 2017

This seems to be a permissions error though as i can get to it using token

@jeremystretch
Copy link
Member

GitHub issues are intended for reporting bugs and requesting features. For general discussion or assistance with installation issues, please post to our mailing list.

@Zanthras
Copy link
Contributor

It might be a bug, i ran into the same issue and resolved it by adding 'django_filters' to the list of installed apps in settings.py.

@mw-0
Copy link
Author

mw-0 commented May 24, 2017

If this is different behavior from 1.96 which i did not see the change then fine. I have the same issue either from my upgraded install or from a fresh install. I have just gone ahead with using authentication instead of using anonymous access to read these parts.

@jeremystretch
Copy link
Member

Looks like something changed in django-filters and/or DRF: carltongibson/django-filter#562 Only new installations of NetBox seem to be affected.

I'll add django_filters to INSTALLED_APPS in the settings.

@jeremystretch jeremystretch reopened this May 24, 2017
lampwins pushed a commit to lampwins/netbox that referenced this issue Oct 13, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants