shanealynn / async_flask

Test of asynchronous flask communication with web page.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

this code is not working

mlotfi2005 opened this issue · comments

Hi,
I downloaded this code, but when run it I got this 👍

(colenv) C:\Users\alotfi\PycharmProjects\async_flask-master
λ python application.py

  • Running on http://127.0.0.1:5000/
  • Restarting with reloader
    Traceback (most recent call last):
    File "C:\Users\alotfi\PycharmProjects\async_flask-master\colenv\lib\site-packages\gevent\greenlet.py", line 327, in run
    result = self._run(_self.args, *_self.kwargs)
    File "C:\Users\alotfi\PycharmProjects\async_flask-master\colenv\lib\site-packages\gevent\server.py", line 102, in wrap_socket_and_handle
    ssl_socket = self.wrap_socket(client_socket, **self.ssl_args)
    TypeError: wrap_socket() got an unexpected keyword argument 'debug'
    <Greenlet at 0x2fac670: <bound method SocketIOServer.wrap_socket_and_handle of <SocketIOServer at 0x2f83ab0 fileno=464 address=127.0.0.1:5000>>(<socket at 0x2fd0d50 fileno=744 sock=127.0.0.1:500, ('127.0.0.1', 59792))> failed with TypeError

Thanks, your help is appreciated.

Thanks mlotfi2005 - I presume that this is an issue with some of the python library versions. I will have to have a look and see if I can find the root source of the problem.

It seems as if you have debug mode engaged - have you tried with app.config['debug'] = False?

Shane

Also - can you confirm that you are using python 2.7, and not 3.3?

Thanks.

It's not working for me either.
Python2.7. Tried on Chrome. The numbers never show up :(

Just get this bit:

Asynchronous Flask Communication
Asynchronous page updates will appear here:

Number list:

There are some comments on the page now that might help:
Download the jquery and socketio files and put this in static directory.
change this code in the head:

change this:
import eventlet
eventlet.monkey_patch()
from flask_socketio import SocketIO, emit

and this:

#turn the flask app into a socketio app
async_mode = “eventlet”

socketio = SocketIO(app, async_mode=async_mode)