File size: 942 Bytes
9e798a1 b856986 27be269 9e798a1 27be269 9e798a1 b856986 9e798a1 b856986 01a1238 b856986 |
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 27 28 29 30 31 32 33 34 |
import ssl
from App.discovery import discover_models
# Set up SSL context for secure database connections
ssl_context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
ssl_context.check_hostname = True
ssl_context.verify_mode = ssl.CERT_REQUIRED
# Discover models
models = discover_models("Model.py")
print("Discovered models:", models)
TORTOISE_ORM = {
"connections": {
"default": {
"engine": "tortoise.backends.asyncpg",
"credentials": {
"host": "ep-patient-darkness-a5bmmt9r.us-east-2.aws.neon.tech",
"port": "5432",
"user": "neondb_owner",
"password": "l2kE5dbMyqfx",
"database": "neondb",
"ssl": ssl_context, # Pass the SSL context here
},
}
},
"apps": {
"models": {
"models": models,
"default_connection": "default",
}
},
}
|