mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +00:00
Add socketio.
This commit is contained in:
parent
3a6fdaa24b
commit
bfe28eca61
@ -3,6 +3,7 @@ from flask import Flask
|
||||
from flask_apscheduler import APScheduler
|
||||
from flask_login import LoginManager
|
||||
from flask_mail import Mail
|
||||
from flask_socketio import SocketIO
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
|
||||
|
||||
@ -11,6 +12,7 @@ login_manager = LoginManager()
|
||||
login_manager.login_view = 'auth.login'
|
||||
mail = Mail()
|
||||
scheduler = APScheduler()
|
||||
socketio = SocketIO()
|
||||
|
||||
|
||||
def create_app(config_name):
|
||||
@ -23,6 +25,7 @@ def create_app(config_name):
|
||||
mail.init_app(app)
|
||||
scheduler.init_app(app)
|
||||
scheduler.start()
|
||||
socketio.init_app(app)
|
||||
|
||||
from .api import api as api_blueprint
|
||||
app.register_blueprint(api_blueprint, url_prefix='/api')
|
||||
|
@ -1,13 +1,16 @@
|
||||
from app import create_app, db
|
||||
from app import create_app, db, socketio
|
||||
from app.models import Corpus, User, Role, Permission, Job
|
||||
from flask_migrate import Migrate
|
||||
import os
|
||||
|
||||
|
||||
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
|
||||
migrate = Migrate(app, db)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
socketio.run(app)
|
||||
|
||||
|
||||
@app.shell_context_processor
|
||||
def make_shell_context():
|
||||
return dict(db=db,
|
||||
|
@ -1,9 +1,11 @@
|
||||
docker==4.0.2
|
||||
eventlet==0.25.0
|
||||
Flask==1.0.3
|
||||
Flask-APScheduler==1.11.0
|
||||
Flask-Login==0.4.1
|
||||
Flask-Mail==0.9.1
|
||||
Flask-Migrate==2.5.2
|
||||
Flask-SocketIO==4.2.1
|
||||
Flask-SQLAlchemy==2.4.0
|
||||
Flask-Table==0.5.0
|
||||
Flask-WTF==0.14.2
|
||||
|
Loading…
Reference in New Issue
Block a user