Closed id4github closed 5 years ago
Thanks for your compliment.
Unfortunately Flask and this package don't mix very well because Flask is sync and this package is async.
But I experimented a bit with using this package together with Quart. Quart is a async web framework with a very similar API to Flask.
There is some very ugly code over on my personal profile. Note that it probably doesn't work anymore with the current release of the ocpp package, but I think you can learn from the approach.
Hey @id4github thanks for your interest. As Auke said, flask doesnt blend so well, but maybe aiohttp can be an option. They have also an api that can mimic flask operations... maybe you can check it out: https://docs.aiohttp.org/en/stable/faq.html
Thanks for the quick reply. I will try these options(Quart , aiohttp).
Great! I will close this issue for now. Feel free to reopen this one or create a new issue if you have questions.
For people landing on this question. I've created a small example of an CSMS integrated with an HTTP API using aiohttp
. The code can be found in this comment,
For people landing on this question. I've created a small example of an CSMS integrated with an HTTP API using
aiohttp
. The code can be found in this comment,
Could you please share the aiohttp version? because I have to try to refer to your code but it not working.
The aiohttp
version is shared in the comment I linked in my previous post.
I have developed OCPP client and server with this awesome library. I wanted to add GUI to the client and server. I intend to use React as frontend and Flask as backend for the application. How to integrate OCPP python client with Flask framework. As the OCPP has its event loop running continuously blocking the flask code. Please help.