Remote-Mouse/src/core/__init__.py

31 lines
659 B
Python
Raw Normal View History

2020-05-28 18:07:53 +00:00
# Python imports
2021-07-19 02:59:33 +00:00
import secrets
2020-05-28 18:07:53 +00:00
# Lib imports
2020-06-12 03:38:20 +00:00
import eventlet
2021-07-19 02:59:33 +00:00
from engineio.payload import Payload
2020-11-22 23:00:20 +00:00
2020-06-12 03:38:20 +00:00
2020-05-28 18:07:53 +00:00
from flask import Flask
from flask_bcrypt import Bcrypt
from flask_login import current_user, login_user, logout_user, LoginManager
2020-06-12 03:38:20 +00:00
from flask_socketio import SocketIO
2020-05-28 18:07:53 +00:00
# Apoplication imports
# Configs and 'init'
app = Flask(__name__)
2021-07-19 02:59:33 +00:00
app.config['TITLE'] = 'RemoteMouse'
app.config['SECRET_KEY'] = secrets.token_hex(32) # For csrf and some other stuff...
2020-05-28 18:07:53 +00:00
2020-06-12 03:38:20 +00:00
# For Websockets
2021-07-19 02:59:33 +00:00
# eventlet.monkey_patch()
Payload.max_decode_packets = 120 # Fix too many small packets causing error
socketio = SocketIO(app, async_mode='eventlet')
2020-11-22 23:40:18 +00:00
2020-05-28 18:07:53 +00:00
from core import routes