Move WSGI initialization into module

This commit is contained in:
Unrud
2018-04-20 22:53:42 +02:00
parent 3f9c34c8b1
commit 8b1547cbe5
3 changed files with 26 additions and 23 deletions

View File

@@ -26,16 +26,8 @@ WSGI-to-FastCGI mapper.
"""
import os
from flup.server.fcgi import WSGIServer
from radicale import Application, config, log
from radicale import application
config_paths = []
if os.environ.get("RADICALE_CONFIG"):
config_paths.append(os.environ["RADICALE_CONFIG"])
configuration = config.load(config_paths, ignore_missing_paths=False)
filename = os.path.expanduser(configuration.get("logging", "config"))
debug = configuration.getboolean("logging", "debug")
logger = log.start("radicale", filename, debug)
WSGIServer(Application(configuration, logger)).run()
WSGIServer(application).run()