~ubuntu-branches/debian/sid/python-django/sid

« back to all changes in this revision

Viewing changes to django/template/context.py

  • Committer: Package Import Robot
  • Author(s): Luke Faraone
  • Date: 2013-11-07 15:33:49 UTC
  • mfrom: (1.3.12)
  • Revision ID: package-import@ubuntu.com-20131107153349-e31sc149l2szs3jb
Tags: 1.6-1
* New upstream version. Closes: #557474, #724637.
* python-django now also suggests the installation of ipython,
  bpython, python-django-doc, and libgdal1.
  Closes: #636511, #686333, #704203
* Set package maintainer to Debian Python Modules Team.
* Bump standards version to 3.9.5, no changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
from copy import copy
2
 
from django.core.exceptions import ImproperlyConfigured
3
 
from django.utils.importlib import import_module
 
2
from django.utils.module_loading import import_by_path
4
3
 
5
4
# Cache of actual callables.
6
5
_standard_context_processors = None
146
145
        collect.extend(_builtin_context_processors)
147
146
        collect.extend(settings.TEMPLATE_CONTEXT_PROCESSORS)
148
147
        for path in collect:
149
 
            i = path.rfind('.')
150
 
            module, attr = path[:i], path[i+1:]
151
 
            try:
152
 
                mod = import_module(module)
153
 
            except ImportError as e:
154
 
                raise ImproperlyConfigured('Error importing request processor module %s: "%s"' % (module, e))
155
 
            try:
156
 
                func = getattr(mod, attr)
157
 
            except AttributeError:
158
 
                raise ImproperlyConfigured('Module "%s" does not define a "%s" callable request processor' % (module, attr))
 
148
            func = import_by_path(path)
159
149
            processors.append(func)
160
150
        _standard_context_processors = tuple(processors)
161
151
    return _standard_context_processors