Giter Site home page Giter Site logo

async_flask's People

Contributors

code-tap avatar rcb4t2 avatar shanealynn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

async_flask's Issues

Python 3.5 version

Is there any chance you could release a python 3.5 version of this? gevent-websocket now supports 3.5...

this code is not working

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.

Would you mind adding a license to this repo?

Hi, I'd love to use and adapt some of your code for a personal project.
In the post on your website, you say

You can find all of the source code on GitHub, with instructions on how to install the necessary libraries etc. Feel free to adapt to your own needs, and leave any comments if you come up with something neat or have any problems.

However, I'd feel much more comfortable using and adapting if there was an actual license file in the repo (e.g. BSD-3-Clause but ultimately, it's your choice :)).

unsupported version of the Socket.IO

Installed package with the following command: pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org Flask-SocketIO==3.1.2

Error when launching the website shows the below information:

The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO)
The client is using an unsupported version of the Socket.IO or Engine.IO protocols

The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO)
The client is using an unsupported version of the Socket.IO or Engine.IO protocols
The client is using an unsupported version of the Socket.IO or Engine.IO protocols

Only the first random generated number is shown, very slow to show new numbers

After a start, the first random generated number is shown instantly. However, subsequent numbers take ages to be displayed on the page. Any ideas?

Click==7.0
Flask==1.0.2
Flask-SocketIO==3.1.2
gevent==1.4.0
greenlet==0.4.15
itsdangerous==1.1.0
Jinja2==2.10
MarkupSafe==1.1.0
python-engineio==3.2.3
python-socketio==3.1.1
six==1.12.0
Werkzeug==0.14.1

gevent version

On some OSes (for example Ubuntu 1604 kernel 4.4.0-62) is needed to upgrade gevent to version 1.0.2. With version 1.0.1 "NameError: name 'PROTOCOL_SSLv3' is not defined" is raised

Of course it is enough to modify requirements.txt accordingly.

application.js file gets a net::ERR_ABORTED 404 (Not Found)

Hello everyone, I'm struggling with this for the past two days :'''(, and I have used it before and it was working.

So, I have just created a WS instance with Ubuntu 18.
I clone the repo in my /var/www/html/ and run the python application
The server seems to be running

`Server initialized for eventlet.

  • Restarting with stat
    Server initialized for eventlet.
  • Debugger is active!
  • Debugger PIN: XXX-XXX-XXX
    (7604) wsgi starting up on http:// 127.0.0.1:5000`

When I load the page in my browser (tested with Chrome and Firefox, same result), I see the following error in the console:

GET http://ec2-XX-XX-XXX-XXX.eu-north-1.compute.amazonaws.com/async_flask/templates/static/js/application.js net::ERR_ABORTED 404 (Not Found)

... complaining about line 6 in the index.html file...

<script src="static/js/application.js"></script>

... so I change this to ...

<script src="../static/js/application.js"></script>

... and now I get this error in the browser console on each polling ...

GET http://ec2-XX-XX-XXX-XXX.eu-north-1.compute.amazonaws.com/socket.io/?EIO=3&transport=polling&t=1586010311097-0 404 (Not Found)

... coming from: socket.io.min.js

I have setup my Security Group in the AWS Dashboard. So there are Inbound rules for HTTP and SSH - 80 and 22 respectively.

pip freeze:
asn1crypto==0.24.0 click==7.1.1 cryptography==2.1.4 dnspython==1.16.0 enum34==1.1.6 eventlet==0.25.1 Flask==1.0.2 Flask-SocketIO==3.1.2 greenlet==0.4.15 gyp==0.1 idna==2.6 ipaddress==1.0.17 itsdangerous==1.1.0 Jinja2==2.11.1 keyring==10.6.0 keyrings.alt==3.0 MarkupSafe==1.1.1 monotonic==1.5 pycrypto==2.6.1 pycurl==7.43.0.1 pygobject==3.26.1 pyliblzma==0.5.3 pysqlite==1.0.1 python-engineio==3.12.1 python-socketio==4.5.1 pyxdg==0.25 rpm==4.14.1 SecretStorage==2.3.1 six==1.11.0 urlgrabber==3.10.2 Werkzeug==1.0.1 yum-metadata-parser==1.1.4

pip3 freeze
asn1crypto==0.24.0 attrs==17.4.0 Automat==0.6.0 blinker==1.4 certifi==2018.1.18 chardet==3.0.4 click==6.7 cloud-init==19.4 colorama==0.3.7 command-not-found==0.3 configobj==5.0.6 constantly==15.1.0 cryptography==2.1.4 distro-info===0.18ubuntu0.18.04.1 dnspython==1.16.0 ec2-hibinit-agent==1.0.0 eventlet==0.25.1 Flask==1.1.2 Flask-SocketIO==4.2.1 gevent==1.4.0 gevent-websocket==0.10.1 greenlet==0.4.15 hibagent==1.0.1 httplib2==0.9.2 hyperlink==17.3.1 idna==2.6 incremental==16.10.1 itsdangerous==1.1.0 Jinja2==2.11.1 jsonpatch==1.16 jsonpointer==1.10 jsonschema==2.6.0 keyring==10.6.0 keyrings.alt==3.0 language-selector==0.1 MarkupSafe==1.0 monotonic==1.5 netifaces==0.10.4 oauthlib==2.0.6 PAM==0.4.2 pyasn1==0.4.2 pyasn1-modules==0.2.1 pycrypto==2.6.1 pygobject==3.26.1 PyJWT==1.5.3 pyOpenSSL==17.5.0 pyserial==3.4 python-apt==1.6.5+ubuntu0.2 python-debian==0.1.32 python-engineio==3.12.1 python-socketio==4.5.1 pyxdg==0.25 PyYAML==3.12 requests==2.18.4 requests-unixsocket==0.1.5 SecretStorage==2.3.1 service-identity==16.0.0 six==1.11.0 ssh-import-id==5.7 systemd-python==234 Twisted==17.9.0 ufw==0.36 unattended-upgrades==0.1 urllib3==1.22 virtualenv==15.1.0 Werkzeug==1.0.1 zope.interface==4.3.2

Apache2:
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: active (running) since Sat 2020-04-04 12:05:02 UTC; 3h 37min ago
Process: 5039 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCESS)
Process: 5044 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 5061 (apache2)
Tasks: 55 (limit: 522)
CGroup: /system.slice/apache2.service
β”œβ”€5061 /usr/sbin/apache2 -k start
β”œβ”€5062 /usr/sbin/apache2 -k start
└─5063 /usr/sbin/apache2 -k start

Apr 04 12:05:02 ip-XXX-XXX-XXX-XXX systemd[1]: Starting The Apache HTTP Server...
Apr 04 12:05:02 ip-XXX-XXX-XXX-XXX systemd[1]: Started The Apache HTTP Server.

Please, I hope someone can help or shed some light here.

example doesn t work

Hi, could you please give update , i am on python 3.7.3 with flaskio and gevent, it works on terminal side but nothing appears on the page ; could you also improve to keep only the last updated value (not the entire list).
thanks !

Not working on Chrome?

I just tried to run application.py. While on Firefox and Edge the page is updated with the numbers normally, on Chrome nothing will load below "Numbers List". How can i solve that?

Python 3.9 now defunct

Only writing this to let you know that the code needs to update to the latest version of python.

get incoming request

hello
how to get incoming request in replace of random number. I use number= request.values.get('test') but the host shows nothing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.