Simple Linux Panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mdserver-web/web/app.py

56 lines
1.6 KiB

6 months ago
# coding=utf-8
7 months ago
# ---------------------------------------------------------------------------------
# MW-Linux面板
# ---------------------------------------------------------------------------------
# copyright (c) 2018-∞(https://github.com/midoks/mdserver-web) All rights reserved.
# ---------------------------------------------------------------------------------
# Author: midoks <midoks@163.com>
# ---------------------------------------------------------------------------------
5 months ago
# import eventlet
# eventlet.monkey_patch()
7 months ago
import sys
6 months ago
import os
7 months ago
5 months ago
# from admin import create_app
6 months ago
from admin import app, socketio
import config
7 months ago
5 months ago
# from gevent.pywsgi import WSGIServer
# from geventwebsocket.handler import WebSocketHandler
6 months ago
7 months ago
if sys.version_info < (3, 6):
raise RuntimeError('This application must be run under Python 3.6 or later.')
# 我们需要在sys.path中包含根目录,以确保我们可以找到在独立运行时运行时所需的一切。
if sys.path[0] != os.path.dirname(os.path.realpath(__file__)):
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
5 months ago
6 months ago
# print(config.DEFAULT_SERVER,config.DEFAULT_SERVER_PORT)
7 months ago
# app = create_app()
5 months ago
7 months ago
def main():
5 months ago
# 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))
7 months ago
app.run(debug=True)
5 months ago
if __name__ == '__main__':
main()