I'm still a newbie in Development ( please don't rate down my post i've reached out everywhere to find a solution for the past 5 days ) , I had only two projects as a tutorial in the second project i had to use Socket IO with flask but its not working - if my code doesnt have socket io in it and i ran flask run
it output the following :
D:\WORK\study sc5\project1\project1>flask run
Serving Flask app "hello"
Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
if it has socket io in it :
D:\WORK\study sc5\project2\project2>flask run
* Serving Flask-SocketIO app "application"
**when i visited 127.0.0.1:5000 i found the server running so i ignored that it doesn't print Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
and kept going tell i made the first test to see if socket io can print and i have noticed everything prints just fine but socket io
I've asked my class mates , made ticket on github for 5 days we couldn't solve this and i have tried on 2 machines ( home windows 10 and work place windows 7 ) both resulting the same thing
i made 2 videos about it ( i'll try to share them here if i'm allowed )
the .py files only have the following
import os
from flask import Flask
from flask_socketio import SocketIO, emit
app = Flask(__name__)
app.config["SECRET_KEY"] = "sdfsdfssefe"
socketio = SocketIO(app)
@app.route("/")
def index():
return "Project 2: TODO"
systems i have this with 1- windows 10 - anacanda 2- windows 7 - anacanda
things i have tried so far :
installing all required to run project 1
import os , passlib,requests
from flask import Flask, session , render_template , request from
flask_session import Session from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker from
passlib.hash import sha256_crypt
instaling eventlet with python 3.7
results all the same except
now after cgywin and python 3.7 when i tried to run my own version of project 2 which used to run smoothly but doesn't print anything from socket io - it now says ( can't import application.py )
pip freeze
I've open ticket on course group , github and videos to demonstrate what happens if anyone could explain how i can upload them i will do edit the post and share them
https://github.com/miguelgrinberg/Flask-SocketIO/issues/807 ( i've also posted videos in the latest comments )
Does this work better?
import os
from flask import Flask
from flask_socketio import SocketIO, emit
@app.route("/")
def index():
return "Project 2: TODO"
app = Flask(__name__)
app.config["SECRET_KEY"] = "sdfsdfssefe"
socketio = SocketIO(app)
if __name__ == '__main__':
socketio.run(app)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.