When running aiohttp.web, the requested url cannot be accessed

according to the official documents provided by aiohttp, I tried the official code:

-sharp main.py
from aiohttp import web

async def index(request):
    return Response(text="hello")
    
app = web.Application()
app.add_routes([web.get("/", index)])
web.run_app(app)

after running this py file, follow the prompt to enter " http://localhost:8080 ", but the page says" cannot access this site ". I am running under the win10 system. What is the reason for this, please?

Apr.06,2022

  1. first check whether the 8080 port is occupied by other programs.
  2. check to see if the agent is used. The agent may have changed the connection configuration.
  3. then check whether the localhost has been modified, that is, check whether C:\ Windows\ System32\ drivers\ etc\ hosts points the localhost to another address, for example, when localhosts is pointed to https://baidu.com, then accessing lo accessing calhost:8080 is actually https://baidu.com:8080, but usually localhost is parsed by DNS, which is unlikely to be the cause of the problem.
  4. try 127.0.0.1 to see if it is accessible, and note that 0.0.0.0 code 8080 cannot access aiohttp clients on windows.
  5. Note that Response is not defined in return Response (text='hello') . You can
   

if none of the above methods are effective, I can only hope that other buddies can help.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b40fb8-2c54c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b40fb8-2c54c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?