forked from fedora-infra/packagedb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pkgdb.wsgi.in
39 lines (30 loc) · 1.09 KB
/
pkgdb.wsgi.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/python -tt
import __main__
__main__.__requires__ = 'TurboGears'
import sys
import os
sys.stdout = sys.stderr
sys.path.append(os.path.join('@DATADIR@', 'fedora-packagedb'))
import pkg_resources
pkg_resources.require("CherryPy<3.0")
os.environ['PYTHON_EGG_CACHE'] = '/var/www/.python-eggs'
import atexit
import cherrypy
import cherrypy._cpwsgi
import turbogears
import fedora.tg.utils
turbogears.config.update({'global': {'mako.directories': [os.path.join(
'@DATADIR@', 'fedora-packagedb/pkgdb/templates')]}})
turbogears.update_config(configfile=os.path.join('@CONFDIR@', 'pkgdb.cfg'),
modulename="pkgdb.config")
# This must always be off when used with mod_wsgi
turbogears.config.update({'global': {'autoreload.on': False}})
import pkgdb.lib.utils
pkgdb.lib.utils.init_globals()
turbogears.startup.call_on_startup.append(fedora.tg.utils.enable_csrf)
import pkgdb.controllers
cherrypy.root = pkgdb.controllers.Root()
if cherrypy.server.state == 0:
atexit.register(cherrypy.server.stop)
cherrypy.server.start(init_only=True, server_class=None)
application = cherrypy._cpwsgi.wsgiApp