hotspot / App /modelInit.py
Mbonea's picture
new age with tortole user works but not tests
b856986
raw
history blame
1.02 kB
from App.discovery import discover_models
DATABASE_URL = "sqlite://db.sqlite3" # Example: SQLite for local development
TORTOISE_ORM = {
"connections": {"default": DATABASE_URL},
"apps": {
"models": {
"models": discover_models("Model.py"), # Automatically discover models in the "models" directory
"default_connection": "default",
}
},
}
# HOST=aws.connect.psdb.cloud
# USERNAME=kn9rzjlad1tw8bvojqg9
# PASSWORD=pscale_pw_hSBO8rcekvnQp74bezC9gjnShhAWgkJYUS8GjGdrBKn
# DATABASE=movie-website
# database = databases.Database(
# "postgresql+asyncpg://postgres:[email protected]:5432/postgres"
# )
# database = databases.Database(
# "postgresql+asyncpg://user:password@db:5432/mydatabase"
# )
# #mysql
# database = databases.Database(
# 'mysql+asyncmy://kn9rzjlad1tw8bvojqg9:pscale_pw_hSBO8rcekvnQp74bezC9gjnShhAWgkJYUS8GjGdrBKn@aws.connect.psdb.cloud/movie-website'
# ,)
# databases = databases.Database(**args)