|
4 | 4 |
|
5 | 5 |
|
6 | 6 | path = pathlib.Path(__file__).parent.absolute()
|
| 7 | + |
| 8 | + |
7 | 9 | 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 = { |
8 | 21 | "global" : {
|
9 | 22 | "server.socket_host" : "127.0.0.1",
|
10 | 23 | "server.socket_port" : 8080,
|
|
14 | 27 |
|
15 | 28 | "tools.trailing_slash.on" : False
|
16 | 29 | },
|
17 |
| - "/static" : { |
18 |
| - "tools.staticdir.on" : True, |
19 |
| - "tools.staticdir.dir" : path.joinpath("templates") |
20 |
| - } |
| 30 | + |
21 | 31 | }
|
22 | 32 |
|
23 | 33 | 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 |
30 | 40 |
|
31 | 41 | 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