#16700: The request_started signal is not called for the first request a newly-
initialized webserver receives.
------------------------------------+-------------------------------
               Reporter:  etianen   |          Owner:  nobody
                   Type:  Bug       |         Status:  new
              Milestone:            |      Component:  Documentation
                Version:  1.3       |       Severity:  Normal
             Resolution:            |       Keywords:
           Triage Stage:  Accepted  |      Has patch:  0
    Needs documentation:  0         |    Needs tests:  0
Patch needs improvement:  0         |  Easy pickings:  0
                  UI/UX:  0         |
------------------------------------+-------------------------------
Changes (by aaugustin):

 * component:  Core (Other) => Documentation
 * stage:  Unreviewed => Accepted


Comment:

 If you declare your signals in the models.py of an application, this
 problem is reproducible with any server that uses `WSGIHandler` —
 '''except the dev server''', because it imports all the models and
 validates them before starting. This might affect signals other than
 `request_started`, depending on where they're connected.

 A workaround is to connect the `request_started` signal in your settings
 module.

 Attached project demonstrates the problem with the WSGI server of the
 standard library. Unpack it and run: `PYTHONPATH=. python
 bug16700/run_me.py`

 I suggest documenting this problem and the workaround as a known pitfall.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16700#comment:3>
Django <https://code.djangoproject.com/>
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to