uvicorn url is not working locally. http://127.0.0.1:8000 #10663
-
First Check
Commit to Help
Example Codefrom fastapi import FastAPI
import uvicorn
import logging
app = FastAPI()
logging.info('Created FASTAPI instance')
@app.get("/")
async def root():
return {"message" : "Hello World!!!"}
logging.info('Method is called') DescriptionI am new to FASTAPI & Python development. Created my first FASTAPI with above code. Options tried
Nothing worked for me Operating SystemWindows Operating System DetailsNo response FastAPI Version0.1.0 Pydantic Version1 Python Version3.9 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Yes, I have tried the same! Postman did not work for me either, but FastApi includes its own user interface to test endpoints, Try http://127.0.0.1:8000/docs#/. If you use this url, you will see the different routes. Click "try it out." Then click execute. LMK if this works! |
Beta Was this translation helpful? Give feedback.
-
Can you please try visiting http://localhost:8000 instead of I'm on a windows machine either, and |
Beta Was this translation helpful? Give feedback.
Can you please try visiting http://localhost:8000 instead of
127.0.0.1
?I'm on a windows machine either, and
127.0.0.1
doesn't work for me sometimes, IDK why, never wondered. Just uselocalhost
...