diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
index ed41c7f..6f063f0 100644
--- a/django/contrib/admin/options.py
+++ b/django/contrib/admin/options.py
@@ -437,6 +437,7 @@ class ModelAdmin(BaseModelAdmin):
             'save_as': self.save_as,
             'save_on_top': self.save_on_top,
             'root_path': self.admin_site.root_path,
+            'admin_site': self.admin_site.name,
         })
         return render_to_response(self.change_form_template or [
             "admin/%s/%s/change_form.html" % (app_label, opts.object_name.lower()),
@@ -571,6 +572,7 @@ class ModelAdmin(BaseModelAdmin):
             'errors': helpers.AdminErrorList(form, formsets),
             'root_path': self.admin_site.root_path,
             'app_label': opts.app_label,
+            'admin_site': self.admin_site.name,
         }
         context.update(extra_context or {})
         return self.render_change_form(request, context, add=True)
@@ -649,6 +651,7 @@ class ModelAdmin(BaseModelAdmin):
             'inline_admin_formsets': inline_admin_formsets,
             'errors': helpers.AdminErrorList(form, formsets),
             'root_path': self.admin_site.root_path,
+            'admin_site': self.admin_site.name,
             'app_label': opts.app_label,
         }
         context.update(extra_context or {})
@@ -681,6 +684,7 @@ class ModelAdmin(BaseModelAdmin):
             'cl': cl,
             'has_add_permission': self.has_add_permission(request),
             'root_path': self.admin_site.root_path,
+            'admin_site': self.admin_site.name,
             'app_label': app_label,
         }
         context.update(extra_context or {})
@@ -736,6 +740,7 @@ class ModelAdmin(BaseModelAdmin):
             "perms_lacking": perms_needed,
             "opts": opts,
             "root_path": self.admin_site.root_path,
+            'admin_site': self.admin_site.name,
             "app_label": app_label,
         }
         context.update(extra_context or {})
@@ -763,6 +768,7 @@ class ModelAdmin(BaseModelAdmin):
             'module_name': capfirst(force_unicode(opts.verbose_name_plural)),
             'object': obj,
             'root_path': self.admin_site.root_path,
+            'admin_site': self.admin_site.name,
             'app_label': app_label,
         }
         context.update(extra_context or {})
diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py
index 42ce296..d77eebd 100644
--- a/django/contrib/admin/sites.py
+++ b/django/contrib/admin/sites.py
@@ -3,6 +3,7 @@ from django import http, template
 from django.contrib.admin import ModelAdmin
 from django.contrib.auth import authenticate, login
 from django.db.models.base import ModelBase
+from django.core.urlresolvers import reverse
 from django.core.exceptions import ImproperlyConfigured
 from django.shortcuts import render_to_response
 from django.utils.functional import update_wrapper
@@ -35,10 +36,7 @@ class AdminSite(object):
     
     def __init__(self, name=None):
         self._registry = {} # model_class class -> admin_class instance
-        # TODO Root path is used to calculate urls under the old root() method
-        # in order to maintain backwards compatibility we are leaving that in
-        # so root_path isn't needed, not sure what to do about this.
-        self.root_path = 'admin/'
+        self.root_path = None
         if name is None:
             name = ''
         else:
@@ -163,7 +161,7 @@ class AdminSite(object):
                 name='%sadmin_index' % self.name),
             url(r'^logout/$',
                 wrap(self.logout),
-                name='%sadmin_logout'),
+                name='%sadmin_logout' % self.name),
             url(r'^password_change/$',
                 wrap(self.password_change),
                 name='%sadmin_password_change' % self.name),
@@ -197,8 +195,12 @@ class AdminSite(object):
         Handles the "change password" task -- both form display and validation.
         """
         from django.contrib.auth.views import password_change
+        if self.root_path is not None:
+            url = '%spassword_change/done/' % self.root_path
+        else:
+            url = reverse('%sadmin_password_change_done' % self.name)
         return password_change(request,
-            post_change_redirect='%spassword_change/done/' % self.root_path)
+            post_change_redirect=url)
     
     def password_change_done(self, request):
         """
@@ -328,6 +330,7 @@ class AdminSite(object):
             'title': _('Site administration'),
             'app_list': app_list,
             'root_path': self.root_path,
+            'admin_site': self.name
         }
         context.update(extra_context or {})
         return render_to_response(self.index_template or 'admin/index.html', context,
@@ -342,6 +345,7 @@ class AdminSite(object):
             'app_path': request.get_full_path(),
             'error_message': error_message,
             'root_path': self.root_path,
+            'admin_site': self.name,
         }
         context.update(extra_context or {})
         return render_to_response(self.login_template or 'admin/login.html', context,
@@ -388,6 +392,7 @@ class AdminSite(object):
             'title': _('%s administration') % capfirst(app_label),
             'app_list': [app_dict],
             'root_path': self.root_path,
+            'admin_site': self.name,
         }
         context.update(extra_context or {})
         return render_to_response(self.app_index_template or 'admin/app_index.html', context,
diff --git a/django/contrib/admin/templates/admin/base.html b/django/contrib/admin/templates/admin/base.html
index e969d1b..623d769 100644
--- a/django/contrib/admin/templates/admin/base.html
+++ b/django/contrib/admin/templates/admin/base.html
@@ -25,7 +25,36 @@
         {% block branding %}{% endblock %}
         </div>
         {% if user.is_authenticated and user.is_staff %}
-        <div id="user-tools">{% trans 'Welcome,' %} <strong>{% firstof user.first_name user.username %}</strong>. {% block userlinks %}{% url django-admindocs-docroot as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %}<a href="{{ root_path }}password_change/">{% trans 'Change password' %}</a> / <a href="{{ root_path }}logout/">{% trans 'Log out' %}</a>{% endblock %}</div>
+        <div id="user-tools">
+            {% trans 'Welcome,' %} 
+            <strong>
+                {% firstof user.first_name user.username %}
+            </strong>. 
+            {% block userlinks %}
+                {% url django-admindocs-docroot as docsroot %}
+                {% if docsroot %}
+                    <a href="{{ docsroot }}">
+                        {% trans 'Documentation' %}
+                    </a> / 
+                {% endif %}
+                {% url admin_site:admin_password_change as password_change_url %}
+                {% if password_change_url %}
+                    <a href="{{ password_change_url }}">
+                {% else %}
+                    <a href="{{ root_path }}password_change/">
+                {% endif %}
+                    {% trans 'Change password' %}
+                </a> / 
+                {% url admin_site:admin_logout as logout_url %}
+                {% if logout_url %}
+                    <a href="{{ logout_url }}">
+                {% else %}
+                    <a href="{{ root_path }}logout/">
+                {% endif %}
+                    {% trans 'Log out' %}
+                </a>
+            {% endblock %}
+        </div>
         {% endif %}
         {% block nav-global %}{% endblock %}
     </div>
diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py
index 0911309..cc3cdd1 100644
--- a/django/template/defaulttags.py
+++ b/django/template/defaulttags.py
@@ -368,6 +368,10 @@ class URLNode(Node):
 
     def render(self, context):
         from django.core.urlresolvers import reverse, NoReverseMatch
+        if len(self.view_name) > 1:
+            self.view_name = Variable(self.view_name[0]).resolve(context) + self.view_name[1]
+        else:
+            self.view_name = self.view_name[0]
         args = [arg.resolve(context) for arg in self.args]
         kwargs = dict([(smart_str(k,'ascii'), v.resolve(context))
                        for k, v in self.kwargs.items()])
@@ -1102,6 +1106,10 @@ def url(parser, token):
         raise TemplateSyntaxError("'%s' takes at least one argument"
                                   " (path to a view)" % bits[0])
     viewname = bits[1]
+    if ':' in viewname:
+        viewname = viewname.split(':')
+    else:
+        viewname = [viewname]
     args = []
     kwargs = {}
     asvar = None
diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py
index 39daf11..7a4f09c 100644
--- a/tests/regressiontests/admin_views/tests.py
+++ b/tests/regressiontests/admin_views/tests.py
@@ -172,6 +172,11 @@ class AdminViewBasicTest(TestCase):
         self.assertRedirects(response, '/test_admin/%s/admin_views/thing/?e=1' % self.urlbit)        
         response = self.client.get('/test_admin/%s/admin_views/thing/' % self.urlbit, {'color__id__exact': 'StringNotInteger!'})
         self.assertRedirects(response, '/test_admin/%s/admin_views/thing/?e=1' % self.urlbit)
+    
+    def testLogoutAndPasswordChangeURLs(self):
+        response = self.client.get('/test_admin/%s/admin_views/article/' % self.urlbit)
+        self.failIf('%s/logout/">' % self.urlbit not in response.content)
+        self.failIf('%s/password_change/">' % self.urlbit not in response.content) 
 
 class CustomModelAdminTest(AdminViewBasicTest):
     urlbit = "admin2"
