update
This commit is contained in:
parent
1bb99bb90e
commit
f4f4e32612
28
web/app.py
28
web/app.py
|
|
@ -12,16 +12,16 @@
|
|||
import sys
|
||||
import os
|
||||
|
||||
# from admin import create_app
|
||||
from admin import app, socketio
|
||||
import config
|
||||
|
||||
# from gevent.pywsgi import WSGIServer
|
||||
# from geventwebsocket.handler import WebSocketHandler
|
||||
from gevent.pywsgi import WSGIServer
|
||||
from geventwebsocket.handler import WebSocketHandler
|
||||
|
||||
from gevent import monkey
|
||||
monkey.patch_all()
|
||||
|
||||
|
||||
# from requests.packages.urllib3.util.ssl_ import create_urllib3_context
|
||||
# create_urllib3_context()
|
||||
|
||||
|
|
@ -38,21 +38,15 @@ if sys.path[0] != os.path.dirname(os.path.realpath(__file__)):
|
|||
|
||||
def main():
|
||||
|
||||
# try:
|
||||
# # http_server = WSGIServer(
|
||||
# # (HOST, PORT), app, handler_class=WebSocketHandler)
|
||||
# # http_server.serve_forever()
|
||||
# # socketio.run(app, host=HOST, port=PORT)
|
||||
# socketio.run(
|
||||
# app,
|
||||
# debug=config.DEBUG,
|
||||
# host=config.DEFAULT_SERVER,
|
||||
# port=7201,
|
||||
# )
|
||||
# except Exception as e:
|
||||
# print(str(e))
|
||||
try:
|
||||
http_server = WSGIServer(
|
||||
(HOST, PORT), app, handler_class=WebSocketHandler)
|
||||
http_server.serve_forever()
|
||||
socketio.run(app, host=config.DEFAULT_SERVER,debug=config.DEBUG)
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
|
||||
app.run(debug=True)
|
||||
# app.run(debug=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ LOG_ROTATION_MAX_LOG_FILES = 5 # 要保留的最大备份数
|
|||
SQLITE_PATH = os.path.join(DATA_DIR, APP_SQLITE_NAME + '.db')
|
||||
|
||||
|
||||
DEFAULT_SERVER = '127.0.0.1'
|
||||
DEFAULT_SERVER = '0.0.0.0'
|
||||
DEFAULT_SERVER_PORT = 7201
|
||||
|
||||
# APP启动时间
|
||||
|
|
|
|||
Loading…
Reference in New Issue