Re: [Django] #14365: Make template-rendering signals available also in DEBUG mode

2019-05-14 Thread Django
#14365: Make template-rendering signals available also in DEBUG mode
---+--
 Reporter:  Carl Meyer |Owner:  Carl Meyer
 Type:  New feature|   Status:  new
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  0  |  Patch needs improvement:  1
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by felixxm):

 * status:  closed => new
 * resolution:  wontfix =>


Comment:

 7 years of silence doesn't mean that this ticket is not valid anymore
 (e.g. few days ago we closed 11 years old ticket). Ticket is targeted to
 master.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.dd2b603281e34af77b2d1c888f3f945a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #14365: Make template-rendering signals available also in DEBUG mode

2019-05-14 Thread Django
#14365: Make template-rendering signals available also in DEBUG mode
---+--
 Reporter:  Carl Meyer |Owner:  Carl Meyer
 Type:  New feature|   Status:  closed
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:  wontfix
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  0  |  Patch needs improvement:  1
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by maribedran):

 * status:  new => closed
 * resolution:   => wontfix


Comment:

 The issue was opened 9 years ago and never revisited after the author
 realized the patch needed more work. It's flagged with the 1.2 version
 which is not supported anymore.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.146bb19200535b714ccb32a489aba3cb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #14365: Make template-rendering signals available also in DEBUG mode

2010-10-09 Thread Django
#14365: Make template-rendering signals available also in DEBUG mode
+---
  Reporter:  carljm | Owner:  carljm
Status:  new| Milestone:
 Component:  Testing framework  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Accepted   | Has_patch:  1 
Needs_docs:  1  |   Needs_tests:  0 
Needs_better_patch:  1  |  
+---
Changes (by carljm):

  * needs_better_patch:  0 => 1

Comment:

 Actually, on further review, this patch needs more work. I used a class
 attribute on Template to avoid a check every time a template is
 instantiated, but introducing an import-time settings dependency is not
 OK.

 Given that there's already a TEMPLATE_DEBUG check in Template.__init__, I
 can probably piggyback on that with almost zero perf impact (I'll
 benchmark, of course), and having the API be via an arg to
 Template.__init__ (defaulting to TEMPLATE_DEBUG) is nicer than a class
 attribute (which is basically a global). Just need to figure out how to
 allow the test system to force it to True...

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #14365: Make template-rendering signals available also in DEBUG mode

2010-10-08 Thread Django
#14365: Make template-rendering signals available also in DEBUG mode
+---
  Reporter:  carljm | Owner:  carljm
Status:  new| Milestone:
 Component:  Testing framework  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Accepted   | Has_patch:  1 
Needs_docs:  1  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by russellm):

  * needs_docs:  0 => 1

Comment:

 Patch looks good, except for the absence of docs. We're adding a new
 public signal, and an API that would allow people to subclass (or
 monkeypatch) Template to turn on that signal.

 Actually, that makes me wonder if Template should maybe take a 'enable
 signals' argument so you can turn on signals on a per-instance basis,
 rather than needing to subclass or monkeypatch...

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #14365: Make template-rendering signals available also in DEBUG mode

2010-09-30 Thread Django
#14365: Make template-rendering signals available also in DEBUG mode
+---
  Reporter:  carljm | Owner:  carljm
Status:  new| Milestone:
 Component:  Testing framework  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Accepted   | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Comment (by carljm):

 Oh, the patch is also available at
 http://github.com/carljm/django/compare/master...ticket_14365

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #14365: Make template-rendering signals available also in DEBUG mode

2010-09-30 Thread Django
#14365: Make template-rendering signals available also in DEBUG mode
+---
  Reporter:  carljm | Owner:  carljm
Status:  new| Milestone:
 Component:  Testing framework  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Accepted   | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by carljm):

  * owner:  nobody => carljm
  * has_patch:  0 => 1

Comment:

 Here's my initial go at a patch. It bases the sending of the signal on the
 value of TEMPLATE_DEBUG, and setup_test_environment forces the sending of
 the signal regardless.

 As you can see, this patch does a boolean if check on every template
 render. This is the simplest, most straightforward code, so I decided to
 try it first and check the performance impact. I added a
 template_render_simple benchmark to djangobench (available at
 http://github.com/carljm/djangobench/tree/template_render_simple) to focus
 on the render call itself and eliminate as much noise as possible. Results
 also attached: djangobench certainly isn't detecting any noticeable
 slowdown; half the time it seems to think it's faster, which suggests to
 me that any impact is so small as to be completely insignificant.

 If someone can detect a statistically significant slowdown from this
 change, or suggest any alternative benchmarking methods that might detect
 one, I have ideas for how the boolean check could be done just once at
 import time. But all of these ideas would involve less readable and
 maintainable code, so I'm going to vote for the simple approach in the
 absence of any evidence of a performance issue.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #14365: Make template-rendering signals available also in DEBUG mode

2010-09-30 Thread Django
#14365: Make template-rendering signals available also in DEBUG mode
+---
  Reporter:  carljm | Owner:  nobody
Status:  new| Milestone:
 Component:  Testing framework  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Accepted   | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by carljm):

  * needs_better_patch:  => 0
  * stage:  Unreviewed => Accepted
  * version:  1.2 => SVN
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 Marking Accepted based on IRC approval-in-concept (depending on
 performance impact) from Russell and Jacob.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #14365: Make template-rendering signals available also in DEBUG mode

2010-09-30 Thread Django
#14365: Make template-rendering signals available also in DEBUG mode
---+
 Reporter:  carljm |   Owner:  nobody
   Status:  new|   Milestone:
Component:  Testing framework  | Version:  1.2   
 Keywords: |   Stage:  Unreviewed
Has_patch:  0  |  
---+
 Django's test setup monkeypatches the template renderer to send a signal
 every time a template is rendered. The test client handles this signal to
 provide template-rendered debugging information.

 It would be useful to have access to this signal in DEBUG mode, not only
 in testing, so that the test Client can be used from the python shell
 without losing the template info, and so external tools like django-debug-
 toolbar can make use of it without having to monkeypatch.

 The original reason for the current behavior was performance; signals used
 to be quite slow. This is no longer the case (and it should be possible to
 make the performance impact in production nothing more than a single DEBUG
 check at startup/init time). Nonetheless, any patch here should come with
 performance impact data.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.