Fixed #4278 -- The `TEMPLATE_DIRS` setting can be overridden by loader.get_template() and loader.select_template(). #1632

Closed
wants to merge 1 commit into from

2 participants

@berkerpeksag

No description provided.

@timgraham timgraham and 1 other commented on an outdated diff Sep 16, 2013
docs/ref/templates/api.txt
``get_template`` returns the compiled template (a ``Template`` object) for
the template with the given name. If the template doesn't exist, it raises
``django.template.TemplateDoesNotExist``.
-.. function:: select_template(template_name_list)
+ To override the :setting:`TEMPLATE_DIRS` setting, you use the *dirs*
@timgraham
Django member

use `` around dirs instead of *
remove "you"
add that dirs may be a list or tuple?

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@timgraham timgraham and 1 other commented on an outdated diff Sep 16, 2013
docs/ref/templates/api.txt
``get_template`` returns the compiled template (a ``Template`` object) for
the template with the given name. If the template doesn't exist, it raises
``django.template.TemplateDoesNotExist``.
-.. function:: select_template(template_name_list)
+ To override the :setting:`TEMPLATE_DIRS` setting, you use the *dirs*
+ parameter.
+
+ ..versionchanged:: 1.7
@timgraham
Django member

missing space after ".." and newline between versionchanged line and the next line (building the docs throws an error "ERROR: Only one argument accepted for directive 'versionchanged::'.
Comments should be provided as content,
not as an extra argument."

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@timgraham timgraham and 1 other commented on an outdated diff Sep 16, 2013
docs/topics/http/shortcuts.txt
@@ -58,6 +58,12 @@ Optional arguments
:ref:`namespaced URL resolution strategy <topics-http-reversing-url-namespaces>`
for more information.
+``dirs``
+ A tuple of value to override the :setting:`TEMPLATE_DIRS` setting.
@timgraham
Django member

or list?
value -> values

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@timgraham timgraham commented on the diff Sep 16, 2013
docs/topics/http/shortcuts.txt
@@ -15,7 +15,7 @@ introduce controlled coupling for convenience's sake.
``render``
==========
-.. function:: render(request, template_name[, dictionary][, context_instance][, content_type][, status][, current_app])
@timgraham
Django member

no tests for the modifications to the shortcut functions?

What is the right place for that tests?

Thanks for the review, @timgraham.

@timgraham
Django member

django/tests/view_tests/tests/test_shortcuts.py looks reasonable

I've added tests for the shortcut functions, rebased and squashed commits.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@berkerpeksag berkerpeksag Fixed #4278 -- The `TEMPLATE_DIRS` setting can be overridden by
loader.get_template() and loader.select_template().
4159699
@timgraham
Django member

merged in 2f0566f - thanks!

@timgraham timgraham closed this Sep 18, 2013
@berkerpeksag berkerpeksag deleted the berkerpeksag:ticket4278-get_template branch Sep 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment