mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 01:39:25 +08:00
Update config.py
This commit is contained in:
@@ -9,7 +9,7 @@ import shutil
|
|||||||
reload(sys)
|
reload(sys)
|
||||||
sys.setdefaultencoding('utf8')
|
sys.setdefaultencoding('utf8')
|
||||||
|
|
||||||
from flask import Flask
|
from flask import Flask, session
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
sys.path.append(os.getcwd() + "/class/core")
|
sys.path.append(os.getcwd() + "/class/core")
|
||||||
@@ -17,13 +17,12 @@ import db
|
|||||||
import public
|
import public
|
||||||
|
|
||||||
|
|
||||||
class MiddleWare:
|
class middleWare:
|
||||||
|
|
||||||
def __init__(self, wsgi_app):
|
def __init__(self, wsgi_app):
|
||||||
self.wsgi_app = wsgi_app
|
self.wsgi_app = wsgi_app
|
||||||
|
|
||||||
def __call__(self, *args, **kwargs):
|
def __call__(self, *args, **kwargs):
|
||||||
# print args
|
|
||||||
return self.wsgi_app(*args, **kwargs)
|
return self.wsgi_app(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
@@ -46,8 +45,8 @@ class config:
|
|||||||
self.initDB()
|
self.initDB()
|
||||||
self.initInitD()
|
self.initInitD()
|
||||||
self.initRoute()
|
self.initRoute()
|
||||||
self.startDebug()
|
# self.startDebug()
|
||||||
app.wsgi_app = MiddleWare(app.wsgi_app)
|
app.wsgi_app = middleWare(app.wsgi_app)
|
||||||
return app
|
return app
|
||||||
|
|
||||||
def startDebug(self):
|
def startDebug(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user