2023-06-03 16:40:54 -04:00
|
|
|
import json
|
2023-06-04 07:16:45 -04:00
|
|
|
|
|
|
|
try:
|
|
|
|
f = open('./config/config.json')
|
|
|
|
data = json.load(f)
|
|
|
|
except:
|
|
|
|
data = {
|
2023-06-09 09:22:50 -04:00
|
|
|
"secret": "SECRET_KEY",
|
2023-06-04 07:16:45 -04:00
|
|
|
"database": {
|
|
|
|
"ip": "localhost",
|
|
|
|
"port": 3306,
|
|
|
|
"user": "user",
|
|
|
|
"password": "password"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-04 07:18:10 -04:00
|
|
|
json_object = json.dumps(data, indent=4)
|
2023-06-04 07:16:45 -04:00
|
|
|
|
|
|
|
with open("config/config.json", "w") as outfile:
|
|
|
|
outfile.write(json_object)
|
|
|
|
|
2023-06-03 16:40:54 -04:00
|
|
|
|
|
|
|
database = data.get("database");
|
2023-06-09 09:22:50 -04:00
|
|
|
secret = data.get("secret")
|