Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #24813 -- Documented {% include %} debug behavior variance #4674

Closed
wants to merge 1 commit into from
Closed

Fixed #24813 -- Documented {% include %} debug behavior variance #4674

wants to merge 1 commit into from

Conversation

akulakov
Copy link
Contributor

Added doc note about difference in handling of missing template by
include tag based on DEBUG setting.

.. note::
If the included template is missing, the effect varies depending on the
:setting:`DEBUG` setting: when ``DEBUG`` mode is on, a
``TemplateDoesNotExist`` exception will be raised; otherwise a blank space
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"otherwise {% include %} silences the exception and returns an empty string."
Also would be helpful to note this behavior applies to any exception that's raised while rendering the included template.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:exc:`~django.template.TemplateDoesNotExist`

@timgraham timgraham changed the title Fixed #24813 -- Added doc note about missing template Fixed #24813 -- Documented {% include %} debug behavior variance May 19, 2015

When debug mode is turned on, :exc:`~django.template.TemplateDoesNotExist` or
:exc:`~django.template.TemplateSyntaxError` exception will be raised;
otherwise {% include %} silences the exception and returns an empty string.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please combine paragraphs and add double backticks around {% include %} for code block highlighting.

Added doc note about difference in handling of missing template by
include tag based on DEBUG setting.
@timgraham
Copy link
Member

merged in fc3409b, thanks!

@timgraham timgraham closed this May 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants