30 lines
696 B
Python
Executable File
30 lines
696 B
Python
Executable File
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
""" Script to launch mandaye with gunicorn server
|
|
"""
|
|
|
|
import sys
|
|
import os
|
|
|
|
from mandaye.log import logger
|
|
from gunicorn.app.wsgiapp import WSGIApplication
|
|
|
|
class WSGIApplication(WSGIApplication):
|
|
|
|
def init(self, parser, opts, args):
|
|
self.cfg.set("default_proc_name", "mandaye.wsgi:application")
|
|
self.app_uri = "mandaye.wsgi:application"
|
|
|
|
sys.path.insert(0, os.getcwd())
|
|
|
|
def main():
|
|
""" The ``gunicorn`` command line runner for launcing Gunicorn with
|
|
generic WSGI applications.
|
|
"""
|
|
logger.info('Launching Mandaye ...')
|
|
WSGIApplication("%prog [OPTIONS]").run()
|
|
|
|
if __name__ == "__main__":
|
|
main()
|