forked from TechStruck/TechStruck-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtortoise_config.py
More file actions
29 lines (25 loc) · 799 Bytes
/
tortoise_config.py
File metadata and controls
29 lines (25 loc) · 799 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
27
28
29
import ssl
from config import common
# TODO: Yet to find a fix for this
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
database_uri = common.config.database_uri
tortoise_config = {
"connections": {
"default": {
"engine": "tortoise.backends.asyncpg",
"credentials": {
"database": database_uri.path[1:],
"host": database_uri.host,
"password": database_uri.password,
"port": database_uri.port or 5432,
"user": database_uri.user,
"ssl": ctx if common.config.no_ssl else None,
},
}
},
"apps": {
"main": {"models": ["models", "aerich.models"], "default_connection": "default"}
},
}