Skip to content

Commit c625bef

Browse files
committed
Backend: Día 6
1 parent 0530f41 commit c625bef

File tree

14 files changed

+57
-60
lines changed

14 files changed

+57
-60
lines changed
0 Bytes
Binary file not shown.
Binary file not shown.

Backend/FastAPI/db/client.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,17 @@
1010

1111
from pymongo import MongoClient
1212

13-
db_client = MongoClient()
13+
# Descomentar el db_client local o remoto correspondiente
14+
15+
# Base de datos local MongoDB
16+
db_client = MongoClient().local
17+
18+
# Clase en vídeo (28/12/2022): https://www.twitch.tv/videos/1691208894
19+
20+
# Base de datos remota MongoDB Atlas (https://mongodb.com)
21+
# db_client = MongoClient(
22+
# "mongodb+srv://<user>:<password>@<url>/?retryWrites=true&w=majority").test
23+
24+
# Despliegue API en la nube:
25+
# Deta - https://www.deta.sh/
26+
# Intrucciones - https://fastapi.tiangolo.com/deployment/deta/
Binary file not shown.

Backend/FastAPI/db/models/user.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
### User model ###
44

55
from pydantic import BaseModel
6+
from typing import Optional
67

78

89
class User(BaseModel):
9-
id: str | None
10+
id: Optional[str]
1011
username: str
1112
email: str
Binary file not shown.

Backend/FastAPI/requirements.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Clase en vídeo (28/12/2022): https://www.twitch.tv/videos/1691208894
2+
fastapi
3+
python-jose
4+
passlib
5+
bcrypt
6+
pymongo
7+
python-multipart
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)