-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathwsgi.py
More file actions
26 lines (19 loc) · 701 Bytes
/
wsgi.py
File metadata and controls
26 lines (19 loc) · 701 Bytes
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
#!usr/bin/env python
# -*- coding: utf-8 -*-
from gevent import monkey
monkey.patch_all()
from gevent.wsgi import WSGIServer
import logging
from logging.handlers import RotatingFileHandler
from manage import app as application
application.jinja_env.cache = {}
if __name__ == '__main__':
formatter = logging.Formatter(
"[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s")
handler = RotatingFileHandler(
'codingpy.log', maxBytes=10000, backupCount=1)
handler.setLevel(logging.WARNING)
handler.setFormatter(formatter)
application.logger.addHandler(handler)
http_server = WSGIServer(('', 8080), application)
http_server.serve_forever()