Changes between Version 6 and Version 8 of Ticket #28752


Ignore:
Timestamp:
11/01/2017 02:36:17 PM (20 months ago)
Author:
Tim Graham
Comment:

Aymeric, any input?

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28752

    • Property Cc Aymeric Augustin added
  • Ticket #28752 – Description

    v6 v8  
    1 I've been bitten numerous times by the impredictable behaviour of django
    2 when django.setup() was called numerous times.
     1I've been bitten numerous times by the impredictable behaviour of django when django.setup() was called numerous times.
    32
    4 In the old days I had exceptions, now it's mainly subtle breakages of
    5 logging configuration.
     3In the old days I had exceptions, now it's mainly subtle breakages of logging configuration.
    64
    7 I couldn't find, in the issue tracker or the dev mailing list statements
    8 about this subject, others than request from other users encountering the
     5I couldn't find, in the issue tracker or the dev mailing list statements about this subject, others than request from other users encountering the
    96problem.
    107
    11 For example this ticket concerned script+importable modules :
    12 https://code.djangoproject.com/ticket/26152
     8For example #26152 concerned script+importable modules.
    139
    14 The latest case in date for me is pytest-django having troubles with
    15 these multiple setup() calls : https://github.com/pytest-dev/pytest-
    16 django/issues/531 , due to multiple fixtures attempting this auto-setup.
     10The 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.
    1711
    18 Would it be OK to make django.setup() idempotent, or even expose a
    19 "is_ready" flag for easier introspection ?
    20 
     12Would it be OK to make django.setup() idempotent, or even expose an "is_ready" flag for easier introspection ?
    2113
    2214-- here are some updates, comments get rejected as spam --
    23 
    24 
    2515
    2616Calling django.setup() multiple times is useless, BUT it can happen in lots of cases, that's why imho this case should be handled by the framework to avoid nasty side effects.
     
    2919
    3020Users have to do a real gym to call setup() "at some moment" in all these use cases, yet try to prevent multiple calls of this initialization step (like the 'if__name__ == "main"' protection). So far my only way out was often to check for (not really undocumented) states of the framework before calling setup().
    31 
    32 
    33 
Back to Top