[Python] Flask auto-reloader not working, though debug-mode is on?

Discussão em 'Python' iniciado por Stack, Janeiro 30, 2025.

  1. Stack

    Stack Membro Participativo

    As can be seen I am loading the config file .env and in addition I'm running with debug=True

    app.py

    from flask import Flask, render_template
    from dotenv import load_dotenv

    # Load environment variables from .env file
    load_dotenv()

    # Create Flask app instance
    app = Flask(__name__)

    @app.route('/')
    def index():
    return render_template('index.html')

    if __name__ == '__main__':
    app.run(debug=True)


    .env:

    FLASK_DEBUG=1
    FLASK_APP=app


    terminal:

    flask run

    * Serving Flask app 'app'
    *** Debug mode: on**
    WARNING: ....
    WSGI server instead.
    * Running on http://127.0.0.1:5000
    Press CTRL+C to quit
    * Restarting with stat
    * Debugger is active!
    * Debugger PIN: 140-343-514


    How can I resolve this? I've tried the Livereloader plugin and it doesn't work. I've tried a different browser. Nothing works. Please can you help?

    Thank you

    Continue reading...

Compartilhe esta Página