Skip to content

Commit bf90c84

Browse files
committed
Update config
1 parent 20b2153 commit bf90c84

File tree

1 file changed

+22
-12
lines changed
  • cherrypy-bootstrap/src/cherrypy_bootstrap

1 file changed

+22
-12
lines changed

cherrypy-bootstrap/src/cherrypy_bootstrap/config.py

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,20 @@
44

55

66
path = pathlib.Path(__file__).parent.absolute()
7+
8+
79
app_config = {
10+
"/": {
11+
"tools.sessions.on": True,
12+
"tools.staticdir.root": "/path/to/static/files",
13+
},
14+
"/static" : {
15+
"tools.staticdir.on" : True,
16+
"tools.staticdir.dir" : path.joinpath("templates")
17+
}
18+
}
19+
20+
global_config = {
821
"global" : {
922
"server.socket_host" : "127.0.0.1",
1023
"server.socket_port" : 8080,
@@ -14,20 +27,17 @@
1427

1528
"tools.trailing_slash.on" : False
1629
},
17-
"/static" : {
18-
"tools.staticdir.on" : True,
19-
"tools.staticdir.dir" : path.joinpath("templates")
20-
}
30+
2131
}
2232

2333
if cherrypy.config.get("environment") == "production":
24-
app_config["global"]["engine.autoreload.on"] = False
25-
app_config["global"]["server.thread_pool"] = 30
26-
app_config["global"]["server.socket_host"] = "0.0.0.0"
27-
app_config["global"]["server.socket_port"] = 80
28-
app_config["global"]["environment"] = "production"
29-
app_config["global"]["log.screen"] = False
34+
global_config["global"]["engine.autoreload.on"] = False
35+
global_config["global"]["server.thread_pool"] = 30
36+
global_config["global"]["server.socket_host"] = "0.0.0.0"
37+
global_config["global"]["server.socket_port"] = 80
38+
global_config["global"]["environment"] = "production"
39+
global_config["global"]["log.screen"] = False
3040

3141
else:
32-
app_config["global"]["environment"] = "development"
33-
app_config['global']['log.screen'] = True
42+
global_config["global"]["environment"] = "development"
43+
global_config['global']['log.screen'] = True

0 commit comments

Comments
 (0)