RockHi friends , can anyone tell me best resource for python backend development
Any resource
Yt , book anything
Check out @PythonRes, a channel for Python resources - video courses, pdf books, tutorials and other info to help you learn Python.
RockHi friends , can anyone tell me best resource for python backend development
Any resource
Yt , book anything
the best way to learn is handle project with senior programmers
Duong Hothe best way to learn is handle project with senior programmers
How should I learn boxing??
Oh, just box with Floyd Mayweather
❤2🤔1
Rockbro i'm student
The given advice wasn't practical
You only gain from that once you're in the intermediate level
❤1
from fastapi import BackgroundTasks
@app.get("/api/health")
async def health(request: Request, background: BackgroundTasks, visit: bool = False):
...
Today i read newly about this BackgroundTask it looks like it is just a replacement of asyncio.to_thread, as this looks like the backgorund task will be done after the response has send with the return it will run side by side of my main funciton. am i right now?
When using a Flask web app with Flask-Login, a cookie is saved in the browser. If a user attempts to modify the cookie key, Flask detects and blocks the login attempt. What is the best equivalent approach in FastAPI? I have heard that I need to manually implement something with middleware, but I do not understand what is required here. Based on your experience, what do I need to learn to implement a standard email and password login mechanism in FastAPI or any better easy way ?
Nandu 😋 Python ExpertWhen using a Flask web app with Flask-Login, a cookie is saved in the browser. If a user attempts to modify the cookie key, Flask detects and blocks the login attempt. What is the best equivalent approach in FastAPI? I have heard that I need to manually implement something with middleware, but I do
json web tokens
😐1
Nandu 😋 Python ExpertWhen using a Flask web app with Flask-Login, a cookie is saved in the browser. If a user attempts to modify the cookie key, Flask detects and blocks the login attempt. What is the best equivalent approach in FastAPI? I have heard that I need to manually implement something with middleware, but I do
https://fastapi.tiangolo.com/tutorial/middleware/
https://fastapi.tiangolo.com/tutorial/security/first-steps/
And no, in APIs you do not use cookies
You use JWT (usually)
👍2
BrainEateЯyou can store jwt in cookies though.
Well yeah, you can
You can store whatever in a cookie
But that is not the usual way how APIs work
Of course, it always depends on the use case
BrainEateЯjson web tokens
i find that JWT, i am currently using fastapi to make normal website with html,css,js here jwt will a good choice ???
Nandu 😋 Python Experti find that JWT, i am currently using fastapi to make normal website with html,css,js here jwt will a good choice ???
Have you read any of the links i sent??
👍2
Omorotionmwan OnaghiseHi guys please I want build an app which measures the morphometric traits of livestock. It should snap the animals in the field and provide the estimated result of the measurement. It can run on Android devices.
How do I do it?
looks like you need an offtopic group, please delete the off-topic message(s) and continue this conversation at @pythonofftopic
In one of my learning fastapi project i did uv run uvicorn main:app which runs the fastapi server there, what i got a new thigns in the terminal output it shows like this i send below here.
i want to know it shows localhost:random_int what is this why sometime this is same and sometime it is different what is this called is this any important, i rather want to shows timestamp when the req came in log in terminal what do you say will those number 47360,48572... needs when?
INFO: Started server process [9693]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:9999 (Press CTRL+C to quit)
INFO: 127.0.0.1:47360 - "GET /api/health HTTP/1.1" 200 OK
INFO: 127.0.0.1:47374 - "GET /api/health HTTP/1.1" 200 OK
INFO: 127.0.0.1:48572 - "GET /api/health HTTP/1.1" 200 OK
INFO: 127.0.0.1:48572 - "GET /api/health HTTP/1.1" 200 OK
INFO: 127.0.0.1:48572 - "GET /api/health HTTP/1.1" 200 OK
INFO: 127.0.0.1:60242 - "GET /api/health HTTP/1.1" 200 OK
INFO: 127.0.0.1:60250 - "GET /api/health HTTP/1.1" 200 OK
INFO: 127.0.0.1:60242 - "GET /api/health HTTP/1.1" 200 OK
👍1
Nandu 😋 Python ExpertIn one of my learning fastapi project i did uv run uvicorn main:app which runs the fastapi server there, what i got a new thigns in the terminal output it shows like this i send below here.
i want to know it shows localhost:random_int what is this why sometime this is same and sometime it is differe
As for the *random ports*
They are called Ephemeral port
https://en.wikipedia.org/wiki/Ephemeral_port
As for the logging see https://apitally.io/blog/fastapi-logging-guide
👍1😐1