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: 3 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.
-
if u r using colab or jupyter notebook u shd use ngrok to use the url as an external port. |
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
...