[Python] The flask app is serving but the link for the website is not generating

Discussão em 'Python' iniciado por Stack, Junho 7, 2025.

  1. Stack

    Stack Membro Participativo

    The flask app is serving and the debug mode is on, but the flask or the app link is not being generated. My machine is Windows 11. I have tried all the methods but the link is not generating nor any error is being produced. What steps should I proceed inorder to correct and get the link for my website. The below is the one which is being displayed in the vscode,

    (venv) PS C:\smartfin_ai> python app.py
    * Serving Flask app 'app'
    * Debug mode: on


    This is my app.py code,

    from flask import Flask
    from core.routes import routes as main_blueprint
    from core.config import Config
    import logging
    import os
    from dotenv import load_dotenv

    # Load environment variables from .env
    load_dotenv()

    def create_app():
    app = Flask(__name__)`

    ` # Set configuration from Config class
    app.config.from_object(Config)

    # Register Blueprint from routes
    app.register_blueprint(main_blueprint)

    # Ensure logs directory exists
    os.makedirs("logs", exist_ok=True)

    # Set up basic logging
    logging.basicConfig(
    filename="logs/app.log",
    level=logging.INFO,
    format="%(asctime)s %(levelname)s %(message)s"
    )

    logging.info("SmartFin AI Flask app initialized.")

    return app
    if __name__ == "__main__":
    app = create_app()
    app.run(debug=True, host='127.0.0.1', port=5050, use_reloader=False)
    print("SmartFin AI is running! Visit http://127.0.0.1:5050 in your browser.")


    I see neither any error nor the print message with the link.

    What steps should I take in order to make it running?

    Continue reading...

Compartilhe esta Página