[Python] Django settings.py statement executed twice

Discussão em 'Python' iniciado por Stack, Julho 23, 2025.

  1. Stack

    Stack Membro Participativo

    I have the following code in my settings.py file and when I startup my server, the print statement gets called twice. Why is that?

    settings.py

    if os.environ.get('DJANGO_DEVELOPMENT'):
    print('Development Mode')
    DEBUG = True
    ADMIN_ENABLED = True


    Console

    Development Mode
    Development Mode
    Performing system checks...

    System check identified no issues (0 silenced).
    July 16, 2020 - 20:34:23
    Django version 3.0.8, using settings 'MyApp.settings'
    Starting development server at http://0.0.0.0:8000/
    Quit the server with CONTROL-C.

    Continue reading...

Compartilhe esta Página