bruth  committed 56af598

updated middleware to log the breadcrumbs trail. added a simple context processor

  • Participants
  • Parent commits d180196

Comments (0)

Files changed (2)


+def breadcrumbs(request):
+    return {'breadcrumbs': request.session.get('breadcrumbs', [])}


+import logging
 from django.core.urlresolvers import reverse, get_resolver, Resolver404
 resolver = get_resolver(None)
         self.view_kwargs = view_kwargs = name
+    def __repr__(self):
+        return '<Crumb "%s" for %s>' % (, self.view_func)
     def _get_view_path(self):
         """Return full view path string."""
         return '.'.join([self.view_func.__module__, self.view_func.__name__])
 class BreadcrumbMiddleware(object):
     def process_view(self, request, view_func, view_args, view_kwargs):
         request.crumb = Crumb(view_func, view_args, view_kwargs)
+        logging.debug('breadcrumb trail:' + repr(request.session.get('breadcrumbs', [])))