blob: 12a41a44c2637d5af9dde5ecb25d8dc91e561d82 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# -*- coding: utf-8 -*-
import json
# try to read config.json if nonexistent create config.json an populate it
try:
with open("config.json", "r", encoding="utf-8") as f:
config = json.load(f)
except FileNotFoundError:
with open("config.json", "w", encoding="utf-8") as f:
config = {
"name": "",
}
f.write(json.dumps(config))
class Config(object):
"""extract secret key to use for the webserver"""
name = config["name"]
|