Code assumes dashboard installed at root URL

Bug #766096 reported by Lorin Hochstein
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Wishlist
Gabriel Hurley

Bug Description

The OpenStack dashboard code currently assumes that the URL will be at the root. For example, installed at example.com/ instead of example.com/dashboard

There are a number of locations in the code where you see this assumption. There's code with hard-coded links relative to "/" such as:
dashboard/templates/base-root.html:
<h1><a href="/">{% site_branding %}<span> Cloud Computing</span></a></h1>

<a id="lnk_login" href="/accounts/login">Sign In</a>
...

 openstack-dashboard/dashboard/templates/base-sidebar.html
      <li class="first"><h3><a href="/">Home</a></h3></li>
...
      <li><h3><a href="/">Projects</a></h3></li>

 openstack-dashboard/dashboard/templates/index.html

 <input type="hidden" name="next" value="/" />

Also, /media is hard-coded as the media-location in base-root.html.

Revision history for this message
Gabriel Hurley (gabriel-hurley) wrote :

A couple notes:

  * "/media" being hardcoded is fixed in https://github.com/4P/openstack-dashboard/commit/333acaffee6d7992afd1a3bef81f5d2e36036464

  * Links to the "/" should be replaced by a proper django url template tag with a named pattern for "home" or something of the sort. However, this is complicated by the fact that the root URL isn't defined in the dashboard URLconf right now, so it's up to the project (e.g. openstack-dashboard or any other replacement) to include that named pattern in its URLconf, and the site will break loudly if people forget to include it.

  * In general, deploying a Django site at a subdirectory isn't as simple as it ought to be. It requires adding a prefix to *all* URL patterns in the project, and changing a number of settings. Take a look at the (now slightly dated) example here: http://djangosnippets.org/snippets/2136/

Changed in openstack-dashboard:
status: New → Confirmed
Devin Carlen (devcamcar)
Changed in openstack-dashboard:
importance: Undecided → Wishlist
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/1317
Committed: http://github.com/openstack/horizon/commit/9742842795e964c7f260aec831665d5cb28cd420
Submitter: Jenkins
Branch: master

 status fixcommitted
 done

commit 9742842795e964c7f260aec831665d5cb28cd420
Author: Gabriel Hurley <email address hidden>
Date: Mon Oct 31 11:31:05 2011 -0700

    Re-architects the OpenStack Dashboard for modularity and extensibility.

    Implements blueprint extensible-architecture.
    Implements blueprint improve-dev-documentation.
    Implements blueprint gettext-everywhere.
    Implements blueprint sphinx-docs.

    Complete re-architecture of the dashboard to transform it from a standalone django-openstack app to a Horizon framework for building dashboards. See the docs for more information.

    Incidentally fixes the following bugs:

    Fixes bug 845868 -- no PEP8 violations.
    Fixes bug 766096 -- the dashboard can now be installed at any arbitrary URL.
    Fixes bug 879111 -- tenant id is now controlled solely by the tenant switcher, not the url (which was disregarded anyway)
    Fixes bug 794754 -- output of venv installation is considerably reduced.

    Due to the scale and scope of this patch I recommend reviewing it on github: https://github.com/gabrielhurley/horizon/tree/extensible_architecture

    Change-Id: I8e63f7ea235f904247df40c33cb66338d973df9e

Changed in horizon:
status: Confirmed → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
milestone: none → essex-1
Changed in horizon:
assignee: nobody → Gabriel Hurley (gabriel-hurley)
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: essex-1 → 2012.1
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.