So, Im doing simple todo-api app with fastapi and sqlmodel. Migrations went fine, but if I run my server, I dont see anything except empy array. I added some data in db file with DB Browser for SQLite, so it isn’t empty. And when I run my server and go to “/”, I see only empty array and no data,
Tag: backend
fastapi logging error and swagger is not working
I’m making a rest API using fastapi. I just wonder why I get below messages whenever I execute my server. And below is main.py. Also, I can’t get anything in swagger and redocs whereas I can get REST methods’ results. Answer You need to change your port to int and app object to str like this:
How to handle an error and make it a result
I’m checking whether the TikTok live video is (live now) or (ended). Since it is hard to deal with TikTok a bit, I will make a sign and rely on it. The following code will take the TikToker username. If there is a live video running, it will show the viewers count, so we decide that it is (live now).
Django – OperationalError after deleting migration files
In the earliest days of my system, before i knew how to utilize django’s built-in User model, i had my own class named myUser which i intended to use for the same purpose. i ended up deleting this one and instead using django’s User model. all was fine for a while. then i tried to change the id of all
How to redirect FastAPI Documentation while running on Docker
I need to redirect “/swagger-ui.html” to the documentation page. I tried: and But, running the project directly (using uvicorn command) I works, but when I put it on a Docker container, it outputs this message on the browser, asking for the location, where nothing works as input: Unable to infer base url. This is common when using dynamic servlet registration