costapy.ditaajipratama.net/pages/configuration/database.md

30 lines
735 B
Markdown
Raw Permalink Normal View History

2023-08-13 21:55:18 +07:00
# Database (config/database.py)
This is the sample template for configure it
db_default = {
'host' : 'localhost',
'user' : 'root',
'password' : '',
'database' : 'your_db',
'autocommit' : True,
}
You also can make more than 1 database configuration like this
db_default = {
'host' : 'localhost',
'user' : 'root',
'password' : '',
'database' : 'your_db',
'autocommit' : True,
}
db_other = {
'host' : 'localhost',
'user' : 'root',
'password' : '',
'database' : 'other_db',
'autocommit' : True,
}