diff --git a/django/contrib/admin/templates/admin_doc/bookmarklets.html b/django/contrib/admin/templates/admin_doc/bookmarklets.html
index 6525014437..94122d0387 100644
--- a/django/contrib/admin/templates/admin_doc/bookmarklets.html
+++ b/django/contrib/admin/templates/admin_doc/bookmarklets.html
@@ -16,16 +16,16 @@ your computer is "internal").
{% endblocktrans %}
-
+
{% trans "Jumps you from any page to the documentation for the view that generates that page." %}
{% trans "Shows the content-type and unique ID for pages that represent a single object." %}
-
+
{% trans "Jumps to the admin page for pages that represent a single object." %}
-
+
{% trans "As above, but opens the admin page in a new window." %}
diff --git a/django/contrib/admin/views/doc.py b/django/contrib/admin/views/doc.py
index 3a36582326..5d73933139 100644
--- a/django/contrib/admin/views/doc.py
+++ b/django/contrib/admin/views/doc.py
@@ -19,8 +19,10 @@ def doc_index(request):
doc_index = staff_member_required(doc_index)
def bookmarklets(request):
+ # Hack! This couples this view to the URL it lives at.
+ admin_root = request.path[:-len('doc/bookmarklets/')]
return render_to_response('admin_doc/bookmarklets', {
- 'admin_url': "%s://%s" % (os.environ.get('HTTPS') == 'on' and 'https' or 'http', request.META['HTTP_HOST']),
+ 'admin_url': "%s://%s%s" % (os.environ.get('HTTPS') == 'on' and 'https' or 'http', request.META['HTTP_HOST'], admin_root),
}, context_instance=DjangoContext(request))
bookmarklets = staff_member_required(bookmarklets)