miguelgrinberg/flask-celery-example 863
This repository contains the example code for my blog article Using Celery with Flask.
Companion code to my PyCon 2016 "Flask at Scale" tutorial session.
miguelgrinberg/api-pycon2015 149
Code for my PyCon talk "Is Your REST API RESTful?"
miguelgrinberg/api-pycon2014 123
Code for my PyCon talk "Writing RESTful Web Services with Flask"
miguelgrinberg/flask-examples 81
Code for my "Python Web Development with Flask" presentation.
Flask running on asyncio!
A microframework based on Werkzeug, Jinja2 and good intentions
A lightweight argparse wrapper inspired by click.
3D Anaglyph image generator
miguelgrinberg/asyncio-testing 25
Unit testing asyncio code
issue commentmiguelgrinberg/Flask-SocketIO
/socket-io/?EIO=3 & transport=websocket failed with 500
@krishmoodbidri this is a Flask question, how is Socket.IO related to this? If Flask does not see a remote user in your incoming requests, then this extension is going to also not have this information.
comment created time in 3 days
issue commentmiguelgrinberg/python-socketio
If i emit a event in a `Thread`, the client can't get the event.
@Abbyyan without monkey patching it will not work. With monkey-patching I believe eventlet still has some issues/bugs that haven't been solved in the implementation of multiprocessing.
comment created time in 3 days
issue commentmiguelgrinberg/python-socketio
If i emit a event in a `Thread`, the client can't get the event.
Gevent is exactly the same as eventlet with regards to blocking and patching. As I said a few times already, you need to learn how to work with these platforms. You are not using standard Python anymore, these are asynchronous frameworks. The rules are different.
comment created time in 4 days
issue commentmiguelgrinberg/python-socketio
If i emit a event in a `Thread`, the client can't get the event.
@Abbyyan I really don't know how to help, this isn't a problem with this package, you need to work around the limitations eventlet imposes in your application. Monkey patching helps in most cases, but not always.
comment created time in 4 days
issue commentmiguelgrinberg/python-socketio
If i emit a event in a `Thread`, the client can't get the event.
You can't use threading and queues with eventlet, they are incompatible. See https://eventlet.net/doc/patching.html for how to monkey patch them to become compatible.
comment created time in 4 days
issue closedmiguelgrinberg/flasky
There was errors in docker compose runing.
Dear miguelgrinberg, When I have checked out 17f, and completed docker compose running, there was logs :
flasky_1 | INFO [alembic.runtime.migration] Context impl MySQLImpl. flasky_1 | INFO [alembic.runtime.migration] Will assume non-transactional DDL. flasky_1 | INFO [alembic.runtime.migration] Running upgrade -> 38c4e85512a9, initial migration flasky_1 | INFO [alembic.runtime.migration] Running upgrade 38c4e85512a9 -> 456a945560f6, login support flasky_1 | INFO [alembic.runtime.migration] Running upgrade 456a945560f6 -> 190163627111, account confirmation flasky_1 | INFO [alembic.runtime.migration] Running upgrade 190163627111 -> 56ed7d33de8d, user roles flasky_1 | INFO [alembic.runtime.migration] Running upgrade 56ed7d33de8d -> d66f086b258, user information flasky_1 | INFO [alembic.runtime.migration] Running upgrade d66f086b258 -> 198b0eebcf9, caching of avatar hashes flasky_1 | INFO [alembic.runtime.migration] Running upgrade 198b0eebcf9 -> 1b966e7f4b9e, post model flasky_1 | INFO [alembic.runtime.migration] Running upgrade 1b966e7f4b9e -> 288cd3dc5a8, rich text posts flasky_1 | INFO [alembic.runtime.migration] Running upgrade 288cd3dc5a8 -> 2356a38169ea, followers flasky_1 | INFO [alembic.runtime.migration] Running upgrade 2356a38169ea -> 51f5ccfba190, comments flasky_1 | [2020-09-21 13:43:55 +0000] [1] [INFO] Starting gunicorn 19.7.1 flasky_1 | [2020-09-21 13:43:55 +0000] [1] [INFO] Listening at: http://0.0.0.0:5000 (1) flasky_1 | [2020-09-21 13:43:55 +0000] [1] [INFO] Using worker: sync flasky_1 | [2020-09-21 13:43:55 +0000] [28] [INFO] Booting worker with pid: 28 flasky_1 | 172.18.0.1 - - [21/Sep/2020:13:55:59 +0000] "GET / HTTP/1.1" 200 3133 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15" flasky_1 | 172.18.0.1 - - [21/Sep/2020:13:55:59 +0000] "GET /static/styles.css HTTP/1.1" 200 - "http://localhost:8000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15" flasky_1 | 172.18.0.1 - - [21/Sep/2020:13:56:00 +0000] "GET /static/favicon.ico HTTP/1.1" 200 - "http://localhost:8000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15"
Home page works. But I have not received confirm email after registering. I remembered I have input correct mail username and password. What's the matter?
closed time in 4 days
franklili3issue commentmiguelgrinberg/Flask-SocketIO
Handling preflight requests with extraHeaders?
@DavidLeibs I don't know what is it specifically that your Safari does not like. When I request the socket.io.js URL it comes back with the correct CORS header that allows all origins.

Do you get a different CORS header there?
comment created time in 4 days
issue commentmiguelgrinberg/Flask-SocketIO
Handling preflight requests with extraHeaders?
@DavidLeibs Can you provide more details on this error? What is the attempted method? What URL? This information should be available from the developer console.
comment created time in 5 days
issue commentmiguelgrinberg/Flask-Migrate
No, this extension works with Flask-SQLAlchemy only. Sorry.
comment created time in 5 days
issue commentmiguelgrinberg/flasky
There was errors in docker compose runing.
You may want to run your application in debug mode, so that Flask-Mail generates logging.
comment created time in 5 days
issue closedmiguelgrinberg/Flask-SocketIO
How to force disconnect the client form server side in python?
closed time in 5 days
kirankumarindpull request commentmiguelgrinberg/python-web-perf
Fix calpaterson's original link
Thanks!
comment created time in 5 days
push eventmiguelgrinberg/python-web-perf
commit sha 6b48f66d17c210aa36d143c4a0c16872b54f0caf
Fix calpaterson's original link (#1)
push time in 5 days
PR merged miguelgrinberg/python-web-perf
Just as title says, add calpaterson's original repository link. By the way, thanks for your excellent work.
pr closed time in 5 days
issue commentmiguelgrinberg/Flask-SocketIO
Create Pipe between two socketio applications
Yes, there are actually two ways. One is with the "external process" technique (docs: https://flask-socketio.readthedocs.io/en/latest/#emitting-from-an-external-process). The other way is by using a Socket.IO client and connecting like the browser would do (docs: https://python-socketio.readthedocs.io/en/latest/client.html)
comment created time in 6 days
issue commentmiguelgrinberg/Flask-SocketIO
Create Pipe between two socketio applications
Well, you seem to have a problem with some low-level networking code, not with this package, right? Why is this package part of the problem?
As for other ways to communicate, two that come to mind are sending HTTP requests, and using a Socket.IO client.
comment created time in 6 days
issue commentmiguelgrinberg/Flask-SocketIO
Create Pipe between two socketio applications
I'm not sure what you mean by "pipe" in this context. You are not showing all your code, but it seems you are just connecting the two processes with a low-level TCP connection? I'm guessing, because I don't know what your Client and Listener classes do.
Are you using eventlet or gevent in these applications? If yes, did you monkey patch the standard library so that socket operations become non-blocking?
comment created time in 6 days
issue closedmiguelgrinberg/flask-video-streaming
How does darknet yolo call the USB camera?
I want to use yolo to call multiple cameras at the same time for identification. Please help me.
closed time in 6 days
asukahanaissue commentmiguelgrinberg/flask-video-streaming
How does darknet yolo call the USB camera?
That has nothing to do with this project, sorry but I cannot help you with yolo, not my thing.
comment created time in 6 days
issue closedmiguelgrinberg/microdot
unable to install microdot on esp8266
import upip upip.install('microdot') Installing to: /lib/ Warning: micropython.org SSL certificate is not validated Error installing 'microdot': syntax error in JSON, packages may be partially installed
closed time in 6 days
ghouse41issue commentmiguelgrinberg/microdot
unable to install microdot on esp8266
The upip is not very robust. Sometimes it reads partial information from the package repository, making it think the data is invalid, other times it just runs out of memory. I suggest you just get the .py file(s) that you are interested in from this repository and copy them into your project.
comment created time in 6 days
issue closedmiguelgrinberg/flasky
i am middle of the project and i was connecting django with gmail and i got this type of error.....
settings.py code for :
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER = os.environ.get('EMAIL_USER') EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_PASS') EMAIL_PORT = 587 EMAIL_USE_TLS = True DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
what should is in this !!!?
closed time in 7 days
msMohit20issue commentmiguelgrinberg/flasky
You have a problem with a Django project. This is a Flask project, you've come to the wrong place to ask your question.
comment created time in 7 days
issue commentmiguelgrinberg/python-socketio
Uninstall the socketio package. That's something else, nothing to do with this package which is called python-socketio.
comment created time in 8 days
issue commentmiguelgrinberg/flask-video-streaming
This is not a notebook app, it is a standalone web server.
comment created time in 8 days
issue commentmiguelgrinberg/Flask-SocketIO
Run the app by calling socketio.run(app) in your main script instead of flask run.
comment created time in 8 days
issue closedmiguelgrinberg/Flask-SocketIO
Hi i need to add authorization for socket to avoid others to access to our socket. How colud i add this feature. can some one help me out.
closed time in 8 days
kirankumarindissue commentmiguelgrinberg/python-socketio
Having multiple websocket connections on the same script
This isn't a WebSocket client, you cannot connect to WS servers with this package. You can only connect to Socket.IO servers.
As far as concurrent connections you can use threads with the standard client, or async tasks with the asyncio client. Both approaches work.
comment created time in 8 days
issue commentmiguelgrinberg/Flask-SocketIO
/socket-io/?EIO=3 & transport=websocket failed with 500
@krishmoodbidri You've got it backwards. uWSGI has native support for WebSocket, gunicorn does not. When you use gunicorn the WS functionality comes from eventlet or gevent-websocket.
comment created time in 8 days
issue commentmiguelgrinberg/Flask-SocketIO
@kirankumarind of course, everything is possible, it's just software. You are not asking any specific questions, so I'm really confused about why you wrote an issue here.
comment created time in 8 days
issue commentmiguelgrinberg/Flask-SocketIO
KeyError: 'Session is disconnected'
I am not familiar with the Java client, so I really don't know. The only potential issue I can think if is that if the server does too much CPU work then it is going to become unresponsive under high load. Not sure if that is your case or not, but with asynchronous servers you always have to watch for CPU use.
comment created time in 8 days
issue commentmiguelgrinberg/flasky
How can I deploy database in aws elastic beanstalk?
I'm not familiar with elastic beanstalk, so I cannot help you with specific questions about that service. The log shows that the upgrade was carried, but you are using a sqlite database, that seems like strange choice for a cloud deployment. How would that work when the service is scaled to multiple instances? Would they all be able to see the same database file?
comment created time in 8 days
issue commentmiguelgrinberg/Flask-SocketIO
socketio.emit manually triggered from another python file
Yes, you can read about that in the docs: https://flask-socketio.readthedocs.io/en/latest/#emitting-from-an-external-process
comment created time in 9 days
issue commentmiguelgrinberg/microblog
Ch09 - form = EmptyForm() in guide but not in repository causes exception
The 0.9 tag points to a8800271547e5cd961817b3b4f347c9f863b0835, which does have EmptyForm. I think you are looking at an older version of this repository.
comment created time in 9 days
issue commentmiguelgrinberg/Flask-SocketIO
KeyError: 'Session is disconnected'
@harrypotter90 wouldn't it make more sense to fix the client to send pings at the correct interval? You can set the interval to anything you want when you create the SocketIO() object, but I'm not sure that is the problem.
comment created time in 9 days
issue closedmiguelgrinberg/flask-twilio-video
On running it is showing connection failed.is the backend working?
closed time in 9 days
techrishiissue commentmiguelgrinberg/flasky-with-celery
Initializing a db instance with celery worker
I would think so. I don't really have experience with this issue, I just Googled the error and found that article.
comment created time in 9 days
issue commentmiguelgrinberg/flasky-with-celery
Initializing a db instance with celery worker
@NamanChuriwala Thanks, now I understand. Please review this blog post, which explains your problem: https://virtualandy.wordpress.com/2019/09/04/a-fix-for-operationalerror-psycopg2-operationalerror-ssl-error-decryption-failed-or-bad-record-mac/.
comment created time in 9 days
issue commentmiguelgrinberg/flasky
flask_sqlalchemy; db.session.commit() does not save changes in database
@kirilgeorgiev82 yes, if you can post your working code here when you have it that would be awesome, as others will find it when they face the same problem. Thanks!
comment created time in 9 days
issue commentmiguelgrinberg/flasky-with-celery
Initializing a db instance with celery worker
You can call db.session.remove() when you are done with your session. I'm not sure what you mean regarding concurrent requests in Celery. First of all, Celery runs jobs, not requests, and second, it runs one job at a time in each worker process. So how can there be concurrent database accesses?
comment created time in 9 days
issue commentmiguelgrinberg/flasky
flask_sqlalchemy; db.session.commit() does not save changes in database
Did you read the SQLAlchemy docs? There is a page specifically about this issue: https://docs.sqlalchemy.org/en/13/orm/extensions/mutable.html.
comment created time in 9 days
issue commentmiguelgrinberg/flasky
flask_sqlalchemy; db.session.commit() does not save changes in database
What is the type of the dictionary attribute in your model?
comment created time in 9 days
push eventmiguelgrinberg/flask-twilio-video
commit sha e62e93d1fa5fc082bb15a57244cdb4387950495c
Add link to installation video
push time in 9 days
issue commentmiguelgrinberg/flask-twilio-video
I recorded a short video in which I go through all the steps in installing and running this application: https://www.youtube.com/watch?v=5hdrW6yEwro.
Hope this helps clarify the process.
comment created time in 9 days
issue commentmiguelgrinberg/flasky
flask_sqlalchemy; db.session.commit() does not save changes in database
I am not sure whether I receive the actual object
There is no concept of objects in the database. SQLAlchemy creates an object representation of the data stored in your database, so in a way all model instances are proxies that represent the real data.
What would be the purpose of doing these strange operations with copy on attributes of the model?
comment created time in 9 days
issue commentmiguelgrinberg/flasky
flask_sqlalchemy; db.session.commit() does not save changes in database
This isn't really enough information for me to tell you what the problem is. The problem is likely not in this code, but instead in the configuration or set up of the application or the database.
comment created time in 9 days
issue commentmiguelgrinberg/flasky
How can I deploy database in aws elastic beanstalk?
The error is (sqlite3.OperationalError) no such table: posts. You did not create/upgrade your database.
comment created time in 9 days
issue commentmiguelgrinberg/Flask-SocketIO
Missing app_context when working with background threads
Creating a test request context doesn't help, a test context does not have information about the client.
What you need to do is pass all the arguments into the function, so that there is no need to fill in the gaps with information from the context. So in addition to the room name, pass the sid of the user in question and the namespace. For the sid you may need to pass it as an argument into your thread function.
So your function would be something like the following:
def foo(room_id, sid):
with app.app_context():
leave_handler(room_id, sid=sid, namespace='/')
comment created time in 10 days
issue commentmiguelgrinberg/Flask-SocketIO
I'm not familiar with this service, so I can't really tell you. The logs clearly show that the endpoint does not speak Socket.IO, it just accepts GET requests. Not sure if this is because you configured a WebSocket endpoint instead of a Socket.IO, but that could be one problem.
comment created time in 10 days
issue commentmiguelgrinberg/Flask-SocketIO
How did you set the /liveticker endpoint in the server?
comment created time in 10 days
issue commentmiguelgrinberg/flasky
How can I deploy database in aws elastic beanstalk?
Overall I think your idea is correct. You have to check the logs of your application to see the stack trace corresponding to the Internal Server Error. That's the only way to move forward.
comment created time in 10 days
issue commentmiguelgrinberg/python-socketio
AsyncServer hangs on request to non-default namespace
Your mistake is thinking in terms of a main function. There is no such thing in an asynchronous system, everything is event-driven. Your main function should just start the connection and then wait.
client = socketio.AsyncClient(
reconnection=False,
logger=True,
engineio_logger=True,
)
async def main():
url = 'ws://localhost:8080'
await client.connect(url, socketio_path='internal/ws', transports=['websocket'], namespaces=['/qwe'])
await client.wait()
Then if you need to do something immediately after connection, start a task in the connect handler:
async def my_logic():
resp = await client.call('foo', {'data': 'some data'}, namespace='/qwe', timeout=5)
print('Resp is ', resp)
@client.event(namespace='/qwe')
async def connect(sid, environ):
client.start_background_task(my_logic)
What do you think about adding an optional flag to connect() which will indicate if we need to wait all connections to be established?
It would be awfully complicated, and there are weird situations that would be hard to handle. For example, if you connect to two namespaces and only one of the connections is established.
comment created time in 10 days
issue commentmiguelgrinberg/Flask-HTTPAuth
how to define decorator for use by multiple modules
Just import the HTTPBasicAuth object that you created into other files in which you need to use it. The "@" thing is called a decorator, it's a Python feature.
comment created time in 11 days
push eventmiguelgrinberg/python-web-perf
commit sha 9a7f4e6bca8d0daad985e4f7865954e61fdb656a
updated readme
push time in 11 days
created tagmiguelgrinberg/python-web-perf
Code for testing performance of popular python webservers
created time in 11 days
push eventmiguelgrinberg/python-web-perf
commit sha 4398618b7ad5e5c759aa367cd2433de0a681a566
more adjustments to tests
push time in 11 days
issue commentmiguelgrinberg/python-socketio
python-socketio token authentication with tornado web server
@kamranhossain are you asking me how to access your Mongo db from Tornado? I wouldn't know, that's not my area of expertise. I supposed any asyncio compatible Mongo library should work.
comment created time in 11 days
issue commentcalpaterson/python-web-perf
@calpaterson I just noticed that you quoted my tweet with results that more or less agree with you. This was before I've found the issues stated above. My results actually have shifted a bit after I fixed these problems, and I cannot say that they agree with yours anymore. Will publish a blog post with my investigation and results shortly.
comment created time in 11 days
issue commentmiguelgrinberg/python-socketio
AsyncServer hangs on request to non-default namespace
Sleeping is a bad way of solving this. As I said above, there is a connect handler that is invoked on each namespace when the connection is established.
Why it was done this way? Because the Socket.IO protocol is asynchronous in nature, there are many messages that are exchanged between the server and the client until the point the connection is established, it's not a single thing.
comment created time in 11 days
issue commentmiguelgrinberg/python-socketio
python-socketio token authentication with tornado web server
Python has a query string parser as well: https://docs.python.org/3/library/urllib.parse.html#urllib.parse.parse_qs.
comment created time in 11 days
issue commentmiguelgrinberg/Flask-SocketIO
AttributeError: 'Request' object has no attribute 'sid'
@JocoYo1 As I said above, your application is request a URL that the server hasn't implemented. This isn't an issue with this package.
comment created time in 11 days
issue commentmiguelgrinberg/Flask-SocketIO
Did you read the documentation?
comment created time in 11 days
issue commentmiguelgrinberg/Flask-SocketIO
Client not receiving message when emitted from another file
its running now but on GPU I think it cant run on CPU.
You can't run CPU intensive tasks in the web server process, as that blocks it.
comment created time in 11 days
issue commentmiguelgrinberg/Flask-SocketIO
Question: Use Sessions within background task
The background task is not associated with a client, so there is no request context. In particular, there is no way to modify the user session there, since the background task has no way to send the updated session cookie back to the client.
comment created time in 12 days
issue commentmiguelgrinberg/Flask-Migrate
db migrate drop all tables in my database
You have multiple db instances in your application. You should use only one, that is imported in all the places you need it.
comment created time in 12 days
issue commentmiguelgrinberg/Flask-SocketIO
AttributeError: 'Request' object has no attribute 'sid'
@JocoYo1 I don't really follow what you are saying. The "not found" error is the 404, it means that the browser is asking for a URL that the server does not know about. It has nothing to do with what you were asking before, it's a different bug that you have in your application.
comment created time in 12 days
issue commentmiguelgrinberg/python-socketio
AsyncServer hangs on request to non-default namespace
I think the problem is that you are not waiting for the connection to be fully established, which would be at the point where the connect handler for the /qwe namespace is called.
comment created time in 12 days
issue commentmiguelgrinberg/Flask-SocketIO
Missing app_context when working with background threads
The correct way to do this is as follows:
-
Start the timer as in your first example:
threading.Timer(30, foo, [room_id]) -
Create an app context when your
foofunction starts:def foo(room_id): with app.app_context(): leave_handler(room_id)
comment created time in 12 days
issue commentmiguelgrinberg/flask-twilio-video
@sr347012 As I asked the OP, please look in the network tab of your browser for errors. Something is obviously happening on your side, but I need some help in debugging this, since I can run the application just fine here.
comment created time in 12 days
issue commentmiguelgrinberg/Flask-Migrate
Issue in SQAlchemy stopped allowing me to make changes to a database with flask migrate
I need to see the stack trace of the error. The problem is likely in your application or in a previous migration file.
comment created time in 12 days
issue closedmiguelgrinberg/Flask-Moment
Request the js files to be retrieved over https from the CDN
When running my app locally in development, it's running under http. This means the js files referenced by Flask-Moment are retrieved over http. This is causing problems when I run some checks with the Lighthouse tool in Chrome Dev Tools. I'd like to be able to force the js references to be via https and not via http.
I propose making a change to include_moment with an optional variable of force_https. The default will be false and the function will work as at present and use whatever the application is running under. If it's set to true then it will use https irrespective of what the application is running.
closed time in 12 days
greendinosaurpull request commentmiguelgrinberg/Flask-Moment
https is always used to request the js files from the CDN
Thank you!
comment created time in 12 days
push eventmiguelgrinberg/Flask-Moment
commit sha a8f42fce6b1f50b73694830975a29bb30d95efdd
https is always used to request the js files from the CDN (#65)
push time in 12 days
PR merged miguelgrinberg/Flask-Moment
I've added a small change to ensure that the js files are requested over https.
To implement this change, I've updated:
- flask_moment.py
- test_flask_moment.py
- README.md
I've run the tests and they're all passing. This is in relation to issue #64
pr closed time in 12 days
issue commentmiguelgrinberg/python-socketio
python-socketio token authentication with tornado web server
Do you get the token in a header? All headers are sent to you in the environ dictionary, using the standard format used by WSGI applications.
comment created time in 12 days
issue commentmiguelgrinberg/python-engineio
Async client ignores ctrl-c after connect fails
Thanks. I have it in my list to review the signal handling changes so I'll have an update on this soon.
comment created time in 12 days
issue commentmiguelgrinberg/Flask-SocketIO
Running With Gunicorn won't request 3rd party APIs? running with flask run gives results okay
https://github.com/miguelgrinberg/Flask-SocketIO/blob/master/example/sessions.py
comment created time in 13 days
issue commentmiguelgrinberg/flask-twilio-video
The backend works, sure. Are you running it? Look in the network tab of your browser to see more details.
comment created time in 13 days
issue commentmiguelgrinberg/Flask-SocketIO
Running With Gunicorn won't request 3rd party APIs? running with flask run gives results okay
@Ahzam-Lathiya there is an example in this repository that shows how to do this. I don't really see anything wrong in your code, you may want to test the example in this repo and adapt it to your needs.
comment created time in 13 days
issue commentmiguelgrinberg/Flask-Moment
Request the js files to be retrieved over https from the CDN
I think it would be okay if we always use https:// for the js dependencies, without a setting. If you make this change and send a PR I'll merge it. Thanks!
comment created time in 13 days
issue commentmiguelgrinberg/greenletio
[question] Appreciation. This will change how MongoDB is used with motor driver.
@zero-shubham yes, the idea is that if an exception is raised inside a greenlet, that exception should be raised in the await of the function wrapped with async_(). I have tested this with requests and that appears to be working. If you have a small example that I can test here I can dig deeper and see why this isn't working in your case.
comment created time in 13 days
issue commentmiguelgrinberg/Flask-Migrate
Updating column type to ARRAY does not register as a change
This is the repository for Flask-Migrate, which is a wrapper for Alembic. Your issue is with Alembic, but note that this package does not check column types by default, that needs to be enabled. See https://stackoverflow.com/questions/33944436/flask-migrate-and-changing-column-type/52181159#52181159 for the solution that I think will apply to your case.
comment created time in 14 days
issue commentmiguelgrinberg/greenletio
[question] Appreciation. This will change how MongoDB is used with motor driver.
Yeah, it will probably work. See the async_requests.py example in this repo, which integrates requests into an async application. PyMongo would use a similar solution. Would love to know if you succeed!
comment created time in 14 days
push eventmiguelgrinberg/greenletio
commit sha 75fc944cefe58ee491e5b8ff951a64f13ae0104d
explanatory comments
push time in 14 days
created tagmiguelgrinberg/greenletio
Asyncio integration with sync code using greenlets.
created time in 14 days
push eventmiguelgrinberg/greenletio
commit sha 2c1ab23a3a969db6258d52ca52258ad5e4ef45b6
handle pending I/O better in async_ function
commit sha ea4e523a95bcf4be709bc37606037c9db539b5c8
Release 0.0.7
push time in 14 days
issue commentmiguelgrinberg/Flask-SocketIO
Then the problem is elsewhere, your connection requests aren't reaching the server.
comment created time in 14 days
issue commentmiguelgrinberg/Flask-SocketIO
I meant the server, not the client, sorry for not being clear. Add engineio_logger=True and logger=True to your SocketIO() class.
comment created time in 14 days
issue commentmiguelgrinberg/microblog
How to integrate Microblog project with the React/Flask setup?
Yes, you would just use functions such as those shown in the API chapter.
comment created time in 14 days
issue commentmiguelgrinberg/Flask-SocketIO
Doesn't look like a CORS issue. Enable Socket.IO and Engine.IO logs to have more details about this error.
comment created time in 15 days
issue commentmiguelgrinberg/Flask-SocketIO
AttributeError: 'Request' object has no attribute 'sid'
Use request.form.get('form-field-name-here').
comment created time in 15 days
issue commentmiguelgrinberg/Flask-SocketIO
Engine.io or websocket instead of socket.io
The error is from Flask. You need to return a response.
comment created time in 15 days
issue commentmiguelgrinberg/Flask-SocketIO
Engine.io or websocket instead of socket.io
Try this:
@app.route('/send', methods=['POST'])
def sendTestMessage():
emit('testmessage', {'data': request.json}, namespace='/', broadcast=True)
comment created time in 15 days
issue commentmiguelgrinberg/Flask-SocketIO
Engine.io or websocket instead of socket.io
Okay, thanks. But flask-socketio only supports socketio, right?
Correct.
is it possible to send data to clients when a url gets a post request?
Yes. Your example will broadcast the message to all your Socket.IO clients. From an HTTP handler it is a bit tricky to know how to only address that same client that sent the HTTP request through a parallel Socket.IO connection.
comment created time in 15 days
issue commentmiguelgrinberg/Flask-SocketIO
Client not receiving message when emitted from another file
Your face_rec.py should be this:
def main_face2():
from __main__ import socketio
# ...
The main file of the application is called __main__, regardless of the filename.
comment created time in 15 days
issue commentmiguelgrinberg/REST-auth
A security question regarding get_user
This is something that needs to be decided for each application. Some applications have public users, so this does not present any privacy issue. Some others, obviously you wouldn't want the list of users to be known, so you would not have a get_user endpoint in your API.
comment created time in 15 days