=== modified file 'django/contrib/admin/options.py'
--- django/contrib/admin/options.py	2007-12-05 19:49:34 +0000
+++ django/contrib/admin/options.py	2007-12-06 10:09:52 +0000
@@ -527,6 +527,7 @@
             'media': mark_safe(media),
             'inline_admin_formsets': inline_admin_formsets,
         })
+        c.update(self.add_view_extra_context(request))
         return self.render_change_form(request, model, c, add=True)
 
     def change_view(self, request, object_id):
@@ -602,6 +603,7 @@
             'media': mark_safe(media),
             'inline_admin_formsets': inline_admin_formsets,
         })
+        c.update(self.change_view_extra_context(request, obj))
         return self.render_change_form(request, model, c, change=True, obj=obj)
 
     def changelist_view(self, request):
@@ -629,6 +631,7 @@
             'cl': cl,
         })
         c.update({'has_add_permission': self.has_add_permission(request)}),
+        c.update(self.changelist_view_extra_context(request, cl))
         return render_to_response(['admin/%s/%s/change_list.html' % (app_label, opts.object_name.lower()),
                                 'admin/%s/change_list.html' % app_label,
                                 'admin/change_list.html'], context_instance=c)
@@ -676,6 +679,7 @@
             "perms_lacking": perms_needed,
             "opts": opts,
         }
+        extra_context.update(self.delete_view_extra_context(request, obj))
         return render_to_response(["admin/%s/%s/delete_confirmation.html" % (app_label, opts.object_name.lower() ),
                                 "admin/%s/delete_confirmation.html" % app_label ,
                                 "admin/delete_confirmation.html"], extra_context, context_instance=template.RequestContext(request))
@@ -701,6 +705,7 @@
             "admin/%s/object_history.html" % opts.app_label,
             "admin/object_history.html"
         ]
+        extra_context.update(self.history_view_extra_context(request, obj))
         return render_to_response(template_list, extra_context, context_instance=template.RequestContext(request))
 
     def formsets_add(self, request):
@@ -710,6 +715,26 @@
     def formsets_change(self, request, obj):
         for inline in self.inline_instances:
             yield inline.formset_change(request, obj)
+        
+    def add_view_extra_context(self, request):
+        """ Extra context for the 'add' admin view. """
+        return {}
+
+    def change_view_extra_context(self, request, obj):
+        """ Extra context for the 'change' admin view. """
+        return {}
+
+    def changelist_view_extra_context(self, request, cl):
+        """ Extra context for the 'change list' admin view. """
+        return {}
+
+    def delete_view_extra_context(self, request, obj):
+        """ Extra context for the 'delete' admin view. """
+        return {}
+
+    def history_view_extra_context(self, request, obj):
+        """ Extra context for the 'history' admin view. """
+        return {}
 
 class InlineModelAdmin(BaseModelAdmin):
     """

=== modified file 'django/contrib/admin/sites.py'
--- django/contrib/admin/sites.py	2007-12-05 15:43:27 +0000
+++ django/contrib/admin/sites.py	2007-12-05 16:24:59 +0000
@@ -293,10 +293,17 @@
         for app in app_list:
             app['models'].sort(lambda x, y: cmp(x['name'], y['name']))
 
-        return render_to_response('admin/index.html', {
-            'title': _('Site administration'),
-            'app_list': app_list,
-        }, context_instance=template.RequestContext(request))
+        context = {
+              'title': _('Site administration'),
+              'app_list': app_list,
+        }
+        context.update(self.index_view_extra_context(request))
+        return render_to_response('admin/index.html', context,
+            context_instance=template.RequestContext(request))
+        
+    def index_view_extra_context(self, request):
+        """ Extra context for the 'index' admin view. """
+        return {}
 
 # This global object represents the default admin site, for the common case.
 # You can instantiate AdminSite in your own code to create a custom admin site.

