Ask Your Question

TemplateDoesNotExist error when adding a new dashboard

asked 2016-11-04 02:53:40 -0600

chansonzhang gravatar image

Hello, When I add an dashboard into /usr/share/openstack-dashboard/openstack_dashboard/dashboards add I create configure files in /usr/share/openstack-dashboard/openstack_dashboard/local/enabled The details are appended in the end. But When I restart the httpd.service and memcached.service, and try to open the dashboard in browser, It gave an "TemplateDoesNotExist" error.

TemplateDoesNotExist at /monitor/
Template-loader postmortem

Django tried loading these templates, in this order:
Using loader horizon.themes.ThemeTemplateLoader:
/usr/share/openstack-dashboard/openstack_dashboard/themes/default/templates/monitor/info/index.html (File does not exist)
Using loader django.template.loaders.filesystem.Loader:
/usr/share/openstack-dashboard/openstack_dashboard/templates/monitor/info/index.html (File does not exist)
Using loader django.template.loaders.app_directories.Loader:
/usr/share/openstack-dashboard/openstack_dashboard/templates/monitor/info/index.html (File does not exist)
/usr/lib/python2.7/site-packages/django/contrib/auth/templates/monitor/info/index.html (File does not exist)
/usr/lib/python2.7/site-packages/compressor/templates/monitor/info/index.html (File does not exist)
/usr/lib/python2.7/site-packages/horizon/templates/monitor/info/index.html (File does not exist)
Using loader horizon.loaders.TemplateLoader:

 # The name of the dashboard to be added to HORIZON['dashboards']. Required.
DASHBOARD = 'monitor'

# If set to True, this dashboard will not be added to the settings.




 PANEL = 'monitor_info_panel'
  PANEL_DASHBOARD = 'monitor'
  PANEL_GROUP = 'monitor'
  ADD_PANEL = ''
  DEFAULT_PANEL = 'monitor_info_panel'

#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

from django.utils.translation import ugettext_lazy as _

from openstack_auth import utils

import horizon

from django.conf import settings

class Monitor(horizon.Dashboard):
    name = _("Monitor")
    slug = "monitor"
    if getattr(settings, 'POLICY_CHECK_FUNCTION', None):
        policy_rules = (('monitor_info_panel', 'admin_required'),)
        permissions = (tuple(utils.get_admin_permissions()),)

from django.utils.translation import ugettext_lazy as _

import horizon

class Info(horizon.Panel):
    name = _("Monitoring Information")
    slug = 'monitor_info_panel'
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2016-11-06 01:23:15 -0600

chansonzhang gravatar image

I may have some thing wrong in my newly added panel, but I can't find out. So I try to copy an entire panel directory from exist admin dashboard, and make some modifications correspondingly. Then all things get ok.

I still wonder what's the real cause of this problem. And if anyone can give me some document about how horizon.loaders.TemplateLoader work, I will appreciate it very much!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2016-11-04 02:53:40 -0600

Seen: 331 times

Last updated: Nov 06 '16