mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[1.8.x] Fixed #24813 -- Documented {% include %} debug behavior variance
Backport of fc3409b093 from master
			
			
This commit is contained in:
		
				
					committed by
					
						 Tim Graham
						Tim Graham
					
				
			
			
				
	
			
			
			
						parent
						
							d3a8ce7658
						
					
				
				
					commit
					5a0e39b2d5
				
			| @@ -695,6 +695,15 @@ available to the included template:: | ||||
|  | ||||
|     {% include "name_snippet.html" with greeting="Hi" only %} | ||||
|  | ||||
| If the included template causes an exception while it's rendered (including | ||||
| if it's missing or has syntax errors), the behavior varies depending on the | ||||
| :class:`template engine's <django.template.Engine>` ``debug`` option (if not | ||||
| set, this option defaults to the value of :setting:`DEBUG`). When debug mode is | ||||
| turned on, an exception like :exc:`~django.template.TemplateDoesNotExist` or | ||||
| :exc:`~django.template.TemplateSyntaxError` will be raised; otherwise | ||||
| ``{% include %}`` silences any exception that happens while rendering the | ||||
| included template and returns an empty string. | ||||
|  | ||||
| .. note:: | ||||
|     The :ttag:`include` tag should be considered as an implementation of | ||||
|     "render this subtemplate and include the HTML", not as "parse this | ||||
|   | ||||
		Reference in New Issue
	
	Block a user