class DocumentAdmin(admin.ModelAdmin): def change_view(self, request, object_id, extra_context={}): """ save the referer of the page to return to the filtered change_list after saving the page """ if len(extra_context) > 0: """ second call of the form (after saving), take the referer from extra_context['ref'], clear extra_context and put the referer in result['Location'] """ ref = extra_context['ref'] result = super(DocumentAdmin, self).change_view(request, object_id, extra_context.clear() ) result['Location'] = ref else: """ first call of the form: add the referer to the context """ extra_context['ref'] = unicode( request.META.get('HTTP_REFERER', '') ) result = super(DocumentAdmin, self).change_view(request, object_id, extra_context ) return result admin.site.register(Document, DocumentAdmin)