| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
Forwardport of ae1d663b7913f6da233c55409c4973248372d302
from stable/1.8.x plus more.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch does three major things:
* Merges the django.template.debug implementation into django.template.base.
* Simplifies the debug implementation.
The old implementation copied debug information to every token and node.
The django_template_source attribute was set in multiple places, some
quite hacky, like django.template.defaulttags.ForNode.
Debug information is now annotated in two high-level places:
* Template.compile_nodelist for errors during parsing
* Node.render_annotated for errors during rendering
These were chosen because they have access to the template and context
as well as to all exceptions that happen during either the parse or
render phase.
* Moves the contextual line traceback information creation from
django.views.debug into django.template.base.Template. The debug views now
only deal with the presentation of the debug information.
|
|
|
|
|
|
|
| |
This test failed because a different error code is raised on Windows when
opening a directory. Since the particular message isn't as important to this
test as the fact that the original IOError is reraised, this fixes the test
by making the assertion more generic.
|
|
|
|
| |
specific exceptions.
|
|
|
|
|
|
|
| |
filesystem loader implementation.
Besides the directories they look in, these two loaders are functionally
the same. This removes unnecessary code duplication between the two.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
A deprecation path is required because the return type of
django.template.loader.get_template changed during the
multiple template engines refactor.
test_csrf_token_in_404 was incorrect: it tested the case when the
hardcoded template was rendered, and that template doesn't depend on the
CSRF token. This commit makes it test the case when a custom template is
rendered.
|
| |
|
| |
|
|
|
|
| |
Adjusted its API through a deprecation path according to the DEP.
|
|
|
|
|
| |
It wasn't documented and it wasn't used anywhere, except in a few tests
that don't test it specifically and can be rewritten with get_template.
|
|
|
|
| |
Running this file as a standalone script doesn't work anyway.
|
|
|
|
|
|
|
|
| |
SimpleTestCase.
These test methods don't need DB setup/teardown.
Refs #23768 and b872134b.
|
|
|
|
|
|
|
|
|
|
|
| |
Passed the engine instance to loaders. This is a prerequisite for
looking up configuration on the engine instance instead of global
settings.
This is backwards incompatible for custom template loaders that override
__init__. However the documentation doesn't talk about __init__ and the
way to pass arguments to custom template loaders isn't specified. I'm
considering it a private API.
|
|
|
|
| |
Cancels 2f0566fa. Refs #4278.
|
|
|
|
|
| |
This provides the opportunity to move utility functions specific to the
Django Template Language outside of django.template.loader.
|
|
|
|
| |
68686430638215b5405b20bd767c0be392c9221d.
|
|
|
|
| |
Thanks Piotr Kasprzyk for help with the patch.
|
|
|
|
|
|
|
| |
empty dictionaries to its Context
Thanks to kezabelle for the report and original patch
and to numerodix for his improved patch.
|
|
|
|
| |
Thanks Michael Manfre for the report.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
filesystem path.
Wherever possible this filesystem path is derived automatically from the app
module's ``__path__`` and ``__file__`` attributes (this avoids any
backwards-compatibility problems).
AppConfig allows specifying an app's filesystem location explicitly, which
overrides all autodetection based on ``__path__`` and ``__file__``. This
permits Django to support any type of module as an app (namespace packages,
fake modules, modules loaded by other hypothetical non-filesystem module
loaders), as long as the app is configured with an explicit filesystem path.
Thanks Aymeric for review and discussion.
|
|
|
|
| |
the tests. It is deprecated in Python 3.4
|
|
|
|
|
| |
It's now easier to achieve the same effect with modify_settings or
override_settings.
|
|
|
|
| |
Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
|
|
|
|
| |
Used the app cache's get_app_configs() method instead.
|
|
|
|
|
|
| |
find_template
Refs #20806. Thanks Unai Zalakain for the review.
|
|
|
|
| |
Signed-off-by: Jason Myers <jason@jasonamyers.com>
|
|
|
|
| |
refs #21230.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
to override TEMPLATE_DIRS.
* django.template.loader.get_template()
* django.template.loader.select_template()
* django.shortcuts.render()
* django.shortcuts.render_to_response()
Thanks amcnabb for the suggestion.
|
|
|
|
| |
Thanks Susan Tan. Refs #19949.
|
|
|
|
|
|
|
| |
TemplateDoesNotExist
Thanks @timgraham and @jdunck for the code reviews and Kronuz for bug
report and initial patch.
|
|
|
|
| |
Previously, the CachedLoaderTests were never run at all.
|
|
|
|
| |
tests that require setuptools.
|
|
|