yezz123 / frdp Goto Github PK
View Code? Open in Web Editor NEWBoilerplate code for quick docker implementation of REST API with JWT Authentication using FastAPI, PostgreSQL and PgAdmin ⭐
License: MIT License
Boilerplate code for quick docker implementation of REST API with JWT Authentication using FastAPI, PostgreSQL and PgAdmin ⭐
License: MIT License
CodeFactor found multiple issues:
not sure if this is bug?:
pydantic.error_wrappers.ValidationError: 1 validation error for blognote
response -> autor
The API should communicate without errors with a simple React UI:
the basic usage is usable:
API URL : http://localhost:5000/api/users/logout
Request Headers
application/json
Request Body
{
"token": "JWT_TOKEN_HERE"
}
Response For success
{
"success": true,
"msg": "Token revoked"
}
Response for unknown token
{
"success": false,
"msg": "User is not logged on"
}
No value for argument 'db' in unbound method call
user = crud_user.CRUDUser.get_by_email(db, email=email)
Hello Yasser,
Thanks for this python API package, it looks really promising.
I was running through the following commands after cloning
make pull
make build
make start
Seeing this log on the app frdp container start
psycopg2.OperationalError: could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
The other services are running and here is the SS of services vs .env file setup.
psql shows the DB list in this way, for the lack of understanding on how to get postgres to work properly am merely looking for some insight. Any help is really appreciate-able.
FastAPI will raise a ValidationError for the invalid response and set the field type. This can go wrong if the response model is not a pydantic model (or dataclass). When trying to produce the string representation of the exception, pydantic will try to produce the errors and fail because of the field type passed into the ValidationError not being a BaseModel or DataclassType. I am not sure if we need something like a ResponseValidationError to prevent this issue.
pydantic.error_wrappers.ValidationError: 1 validation error for Msg
response -> msg
field required (type=value_error.missing)
class Msg(BaseModel):
msg: int
@router.post("/password-recovery/{email}", response_model=Msg)
def recover_password(email: str, db: Session = Depends(deps.get_db)) -> Any:
"""
Password Recovery
"""
user = user1.get_by_email(db, email=email)
if not user:
raise HTTPException(
status_code=404,
detail="The user with this username does not exist in the system.",
)
password_reset_token = generate_password_reset_token(email=email)
return {"Message": "Password recovery email sent"}
CodeFactor found multiple issues last seen at dcfcafe:
pip install --no-cache-dir <package>
--no-install-recommends
CodeFactor found multiple issues:
pip install --no-cache-dir <package>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.