Commits

hu...@bcc190cf-cafb-0310-a4f2-bffc1f526a37  committed b806514

new_admin: merged to trunk r1385

  • Participants
  • Parent commits 39a3c7e
  • Branches new-admin

Comments (0)

Files changed (2)

File django/views/debug.py

 HIDDEN_SETTINGS = re.compile('SECRET|PASSWORD')
 
 def linebreak_iter(template_source):
-    newline_re = re.compile("^", re.M)
-    for match in newline_re.finditer(template_source):
-        yield match.start()
+    p = template_source.find('\n')
+    while p >= 0:
+        yield p
+        p = template_source.find('\n', p+1)
     yield len(template_source) + 1
 
 def get_template_exception_info(exc_type, exc_value, tb):
   </div>
 </body>
 </html>
-"""
+"""

File docs/settings.txt

 used so that application data can hook into specific site(s) and a single
 database can manage content for multiple sites.
 
+TEMPLATE_DEBUG
+--------------
+
+Default: ``False``
+
+**Only available in Django development version.**
+
+A boolean that turns on/off template debug mode. If this is ``True``, the fancy
+error page will display a detailed report for any ``TemplateSyntaxError``. This
+report contains the relevant snippet of the template, with the appropriate line
+highlighted.
+
+Note that Django only displays fancy error pages if ``DEBUG`` is ``True``, so you'll
+want to set that to take advantage of this setting.
+
+See also DEBUG.
+
 TEMPLATE_DIRS
 -------------