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
@ -1,2 +1,2 @@
|
|||||||
FLASK_APP=opaque.py
|
#FLASK_APP=opaque.py
|
||||||
FLASK_ENV=development
|
FLASK_ENV=development
|
||||||
|
@ -3,6 +3,7 @@ from flask import Flask
|
|||||||
from flask_apscheduler import APScheduler
|
from flask_apscheduler import APScheduler
|
||||||
from flask_login import LoginManager
|
from flask_login import LoginManager
|
||||||
from flask_mail import Mail
|
from flask_mail import Mail
|
||||||
|
from flask_socketio import SocketIO
|
||||||
from flask_sqlalchemy import SQLAlchemy
|
from flask_sqlalchemy import SQLAlchemy
|
||||||
|
|
||||||
|
|
||||||
@ -11,6 +12,7 @@ login_manager = LoginManager()
|
|||||||
login_manager.login_view = 'auth.login'
|
login_manager.login_view = 'auth.login'
|
||||||
mail = Mail()
|
mail = Mail()
|
||||||
scheduler = APScheduler()
|
scheduler = APScheduler()
|
||||||
|
socketio = SocketIO()
|
||||||
|
|
||||||
|
|
||||||
def create_app(config_name):
|
def create_app(config_name):
|
||||||
@ -23,6 +25,7 @@ def create_app(config_name):
|
|||||||
mail.init_app(app)
|
mail.init_app(app)
|
||||||
scheduler.init_app(app)
|
scheduler.init_app(app)
|
||||||
scheduler.start()
|
scheduler.start()
|
||||||
|
socketio.init_app(app)
|
||||||
|
|
||||||
from .api import api as api_blueprint
|
from .api import api as api_blueprint
|
||||||
app.register_blueprint(api_blueprint, url_prefix='/api')
|
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 app.models import Corpus, User, Role, Permission, Job
|
||||||
from flask_migrate import Migrate
|
from flask_migrate import Migrate
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
|
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
|
||||||
migrate = Migrate(app, db)
|
migrate = Migrate(app, db)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
socketio.run(app)
|
||||||
|
|
||||||
|
|
||||||
@app.shell_context_processor
|
@app.shell_context_processor
|
||||||
def make_shell_context():
|
def make_shell_context():
|
||||||
return dict(db=db,
|
return dict(db=db,
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
docker==4.0.2
|
docker==4.0.2
|
||||||
|
eventlet==0.25.0
|
||||||
Flask==1.0.3
|
Flask==1.0.3
|
||||||
Flask-APScheduler==1.11.0
|
Flask-APScheduler==1.11.0
|
||||||
Flask-Login==0.4.1
|
Flask-Login==0.4.1
|
||||||
Flask-Mail==0.9.1
|
Flask-Mail==0.9.1
|
||||||
Flask-Migrate==2.5.2
|
Flask-Migrate==2.5.2
|
||||||
|
Flask-SocketIO==4.2.1
|
||||||
Flask-SQLAlchemy==2.4.0
|
Flask-SQLAlchemy==2.4.0
|
||||||
Flask-Table==0.5.0
|
Flask-Table==0.5.0
|
||||||
Flask-WTF==0.14.2
|
Flask-WTF==0.14.2
|
||||||
|
Loading…
Reference in New Issue
Block a user