FlaskUI Desktop App Error: "127.0.0.1 refused to connect" when run as administrator

20 views Asked by At

I'm developing a desktop application using FlaskUI, HTML, CSS, and JavaScript, with the intention of creating an executable (.exe) file. The application requires administrative privileges to function properly. However, when I run the executable file or my development environment (e.g., VS Code) as an administrator, the application fails to connect and displays the error message "127.0.0.1 refused to connect."

I've attempted running both the executable file and VS Code with administrative privileges, but the issue persists. Strangely, the application works as expected when run without elevated privileges.

What could be causing this problem, and how can I resolve it to ensure the application functions correctly even when run as an administrator?

Any insights or suggestions would be greatly appreciated. Thank you!

from flask import Flask, render_template
from flaskwebgui import FlaskUI

app = Flask(__name__)

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

if __name__ == '__main__':
    # app.run(debug = True)
    FlaskUI(app=app, server="flask", width=370, height=535).run()

What I've Tried:

  1. Running the executable file generated from my FlaskUI application with administrative privileges.
  2. Running my development environment (Visual Studio Code) as an administrator.
  3. Investigating network-related configurations to ensure proper connection establishment.
  4. Seeking assistance from online forums and asking for help here, but haven't found a solution yet.
0

There are 0 answers