forked from mouredev/Hello-Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.py
More file actions
26 lines (18 loc) · 889 Bytes
/
client.py
File metadata and controls
26 lines (18 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Clase en vídeo (22/12/2022): https://www.twitch.tv/videos/1686104006
### MongoDB client ###
# Descarga versión community: https://www.mongodb.com/try/download
# Instalación:https://www.mongodb.com/docs/manual/tutorial
# Módulo conexión MongoDB: pip install pymongo
# Ejecución: sudo mongod --dbpath "/path/a/la/base/de/datos/"
# Conexión: mongodb://localhost
from pymongo import MongoClient
# Descomentar el db_client local o remoto correspondiente
# Base de datos local MongoDB
db_client = MongoClient().local
# Clase en vídeo (28/12/2022): https://www.twitch.tv/videos/1691208894
# Base de datos remota MongoDB Atlas (https://mongodb.com)
# db_client = MongoClient(
# "mongodb+srv://<user>:<password>@<url>/?retryWrites=true&w=majority").test
# Despliegue API en la nube:
# Deta - https://www.deta.sh/
# Intrucciones - https://fastapi.tiangolo.com/deployment/deta/