- view_func = view_functions[endpoint]
-
- _log.debug('endpoint: {0} view_func: {1}'.format(
- endpoint,
- view_func))
-
- # import the endpoint, or if it's already a callable, call that
- if isinstance(view_func, unicode) \
- or isinstance(view_func, str):
- controller = common.import_component(view_func)
- else:
- controller = view_func
+ controller = endpoint_to_controller(found_rule)
+ # Make a reference to the controller's symbolic name on the request...
+ # used for lazy context modification
+ request.controller_name = found_rule.endpoint