armstrong/armstrong — Issue #39: hardcoded value in the AJAX URL for initVisualSearch.valueMatches()
Author: joncotton
Created: 2011-11-05 00:48:46+00:00
State: open
Labels: hatband

The [$.getJSON()](https://github.com/armstrong/armstrong.hatband/blob/master/armstrong/hatband/static/generickey.js#L76) call in hatband/static/generickey.js initVisualSearch.valueMatches() is hard-coded to use *'/admin/'*. This should somehow detect (or be given) the actual base URL to use.

On the Django side the URL routing works fine.
Say the route is setup in `urls.py` like:

(r'^different_admin/', include(admin.site.urls)),

Doing this gives the correct result:

>>> reverse("admin:articles_article_search", args=("articles", "article"))
'/different_admin/articles/article/search/'