I have a flask-socketIO application where the breakpoints in my socket.py file are not working.
in __init__.py
i have the following code:
from flask import Flask
from flask_socketio import SocketIO
async_mode = None
app = Flask(__name__)
app.config.from_object('config')
socketio = SocketIO(app, async_mode=async_mode)
from .auth import SamlManager
saml_manager = SamlManager()
saml_manager.init_app(app)
from app import views, socket, saml_func
<end>
socket.py:
from app import socketio
@socketio.on('my_event', namespace='/socket')
def test_message(message):
emit('my_response', {'data': 'received data'})
if I put a breakpoint anywhere in socket.py, including the imports However, any other code such as views.py, breakpoints are working
views.py:
from app import app, socketio, saml_manager
from flask import render_template
@app.route('/', methods=['GET', 'POST'])
@app.route('/index', methods=['GET', 'POST'])
@saml_manager.login_required
def index():
return render_template('index.html', async_mode=socketio.async_mode)
Any idea why breakpoints would not be working for socket but would be working for views since I am calling them the same way?