#28752: Django.setup() should be idempotent
------------------------------------------+------------------------
               Reporter:  pascal chambon  |          Owner:  nobody
                   Type:  Bug             |         Status:  new
              Component:  Core (Other)    |        Version:  1.11
               Severity:  Normal          |       Keywords:
           Triage Stage:  Unreviewed      |      Has patch:  0
    Needs documentation:  0               |    Needs tests:  0
Patch needs improvement:  0               |  Easy pickings:  0
                  UI/UX:  0               |
------------------------------------------+------------------------
 I've been bitten numerous times by the impredictable behaviour of django
 when django.setup() was called numerous times.

 In the old days I had exceptions, now it's mainly subtle breakages of
 logging configuration.

 I couldn't find, in the issue tracker or the dev mailing list statements
 about this subject, others than request from other users encountering the
 problem.

 For example this ticket concerned script+importable modules :
 https://code.djangoproject.com/ticket/26152

 The latest case in date for me is pytest-django having troubles with these
 multiple setup() calls : https://github.com/pytest-dev/pytest-
 django/issues/531 , due to multiple fixtures attempting this auto-setup.

 Would it be OK to make django.setup() idempotent, or even expose a
 "is_ready" flag for easier introspection ?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28752>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/048.0d98c845609066b6033ab7908a17e110%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to