Não consigo utilizar o local host 127.0.0.1 para run de app Flask

2023-08-06T18:45:13.99+00:00

Toda vez que rodo a minha aplicaçao, o retorno ´esse e não consigo acessar o localhost:5000

  • Serving Flask app 'app'
  • Debug mode: off

WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.

Press CTRL+C to quit

127.0.0.1 - - [06/Aug/2023 15:18:15] "GET / HTTP/1.1" 405 -

127.0.0.1 - - [06/Aug/2023 15:18:16] "GET /favicon.ico HTTP/1.1" 404 -

127.0.0.1 - - [06/Aug/2023 15:19:10] "GET / HTTP/1.1" 405 -

127.0.0.1 - - [06/Aug/2023 15:19:11] "GET /favicon.ico HTTP/1.1" 404 -

127.0.0.1 - - [06/Aug/2023 15:19:37] "GET / HTTP/1.1" 405 -

127.0.0.1 - - [06/Aug/2023 15:19:43] "GET / HTTP/1.1" 405 -

127.0.0.1 - - [06/Aug/2023 15:20:53] "GET / HTTP/1.1" 405 -

Internet Information Services
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,726 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,696 Reputation points
    2023-08-07T10:53:19.1866667+00:00

    Hello there,

    f you're unable to use "localhost" or "127.0.0.1" to run your Flask app, there might be a configuration issue or conflict on your system. Here are some troubleshooting steps to help you resolve the issue:

    Check Port Availability:

    Make sure that the port you're using to run your Flask app (e.g., 5000) is not already in use by another application. You can try a different port to see if that resolves the issue.

    Firewall and Antivirus:

    Sometimes, firewall settings or antivirus software can interfere with local network communication. Temporarily disable your firewall or antivirus software and see if you can access the Flask app using "localhost" or "127.0.0.1."

    Hosts File:

    Ensure that your system's hosts file hasn't been modified to redirect "localhost" or "127.0.0.1" to a different IP address. The hosts file is located at C:\Windows\System32\drivers\etc\hosts on Windows or /etc/hosts on Linux/Mac. Open the file with administrative privileges and make sure there are no unwanted entries.

    Proxy Settings:

    If you're behind a proxy, your network settings might be affecting your ability to use "localhost" or "127.0.0.1." Check your proxy settings and see if disabling the proxy resolves the issue.

    Network Configuration:

    Sometimes, network configuration issues can cause problems with local loopback addresses. You can try running the Flask app on a different network (e.g., a different Wi-Fi network or a wired connection) to see if the issue persists.

    Browser Cache:

    Clear your browser cache and cookies, as cached data can sometimes cause issues with accessing local sites.

    Loopback Exemption:

    On Windows, there's a feature called "Loopback Exemption" that can cause issues with accessing local addresses. To check if it's enabled, open a command prompt with administrative privileges and run:

    Copy code

    CheckNetIsolation LoopbackExempt -s

    If your application isn't listed, you can add it using:

    css

    Copy code

    CheckNetIsolation LoopbackExempt -a -n=<PackageFamilyName>

    Replace `<Package

    I used AI provided by ChatGPT to formulate part of this response. I have verified that the information is accurate before sharing it with you.

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer–

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.