From c1316fad537c6661decbce90ebc2a96e2fdc4b89 Mon Sep 17 00:00:00 2001 From: inpos Date: Sun, 15 May 2016 11:06:43 +0300 Subject: [PATCH] =?UTF-8?q?fcgi-=D1=81=D0=BA=D1=80=D0=B8=D0=BF=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lybrary.fcgi | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 lybrary.fcgi diff --git a/lybrary.fcgi b/lybrary.fcgi new file mode 100644 index 0000000..a5613b5 --- /dev/null +++ b/lybrary.fcgi @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +import sys +sys.path.insert(0, "/path/to/lybrary/root/dir") + +from lybmods import lybrary, lybpqconn, lybpqsession +from lybmods.lybformauth import check_auth +from lybmods import lybcfg +import cherrypy +from flipflop import WSGIServer + +cherrypy.log.screen = None +#cherrypy.log.access_file='/tmp/lybrary/logs/pyaccess.log' +#cherrypy.log.error_file='/tmp/lybrary/logs/pyerror.log' + +lybpqconn.create_schema() +cherrypy.lib.sessions.PgsqlSession = lybpqsession.PgsqlSession +cherrypy.tools.auth = cherrypy.Tool('before_handler', check_auth) +cherrypy.tree.mount(lybrary.Root(), script_name='/lybrary.fcgi') +cherrypy.engine.autoreload.unsubscribe() +cherrypy.server.unsubscribe() +WSGIServer(cherrypy.tree).run()