Wrong url pattern in Horizon tutorial

Bug #1427758 reported by Manuel Requena
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Chris Johnson

Bug Description

I'm following the Horizon tutorial and the definition of the URL pattern in [1] seems to be wrong. The text says:
"Replace the existing url pattern with the following line:
url(r'^\?tab=mypanel_tabs__tab$',
    views.IndexView.as_view(), name='mypanel_tabs'),
"

If I run the test server, I get the following error
Error reversing absolute URL for <Panel: mypanel>: Reverse for 'index' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
...
  File "/var/data/testing-horizon/git-repos/horizon/.venv/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 456, in _reverse_with_prefix
    (lookup_view_s, args, kwargs, len(patterns), patterns))
NoReverseMatch: Reverse for 'index' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []

If I change the url pattern with the following:
    url(r'^$',
        views.IndexView.as_view(), name='index'),

then the new MyDashboard/Mypanel works.

[1] http://docs.openstack.org/developer/horizon/topics/tutorial.html#urls

tags: added: documentation
Changed in horizon:
assignee: nobody → Chris Johnson (wchrisjohnson)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/161521

Changed in horizon:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/161521
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=d76708e62b3d226830d1863afb7006a194a826e6
Submitter: Jenkins
Branch: master

commit d76708e62b3d226830d1863afb7006a194a826e6
Author: Chris Johnson <email address hidden>
Date: Wed Mar 4 16:38:26 2015 -0800

    Fix tutorial to correctly display custom dashboard/panel

    This change fixes a bug in the "Building a Dashboard using
    Horizon" tutorial in the Horizon developer documentation.
    The tutorial shows new Horizon developers how to build a
    custom dashboard and panel that displays running instances.

    In the tutorial, the URL pattern provided fails to display
    the custom dashboard & panel. This change updates the URL
    pattern. The custom dashboard and panel now correctly show
    the custom view of instances data.

    Documentation has been regenerated and reviewed to ensure
    change was correctly done.

    DocImpact
    Closes-Bug: #1427758

    Change-Id: I522825c6d24fcaf0981f5faab273e2efd6e00f1a

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
milestone: none → kilo-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: kilo-3 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.