Custom Search

Wednesday, February 26, 2014

OpenStack Horizon How to find and use urls of dashboard components

1)
How to find Url name for /project or http://127.0.0.1:8000/project


a)
openstack_dashboard/dashboards/project/overview/urls.py

urlpatterns = patterns('openstack_dashboard.dashboards.project.overview.views',
    url(r'^$', views.ProjectOverview.as_view(), name='index'),
    url(r'^warning$', views.WarningView.as_view(), name='warning'),
)

In the above example url(r'^$', views.ProjectOverview.as_view(), name='index') point you to http://127.0.0.1:8000/project

b)
How to use above url name in python and html files
In python
-------------------

from django.core.urlresolvers import reverse_lazy
LOGIN_REDIRECT_URL = reverse_lazy('horizon:project:overview:index')


In Html
---------------

{%url 'horizon:project:overview:index' %}


No comments:

Post a Comment